Tim Maxey .NET Technology Blog & Resources
JavaScript
Post of JavaScript Code
Here is the easiest way to hide or rather disable the asp.net button control, or any other control for that matter, take this:
<div id="dwait" style="display:none">please wait, creating account...</div>
<div id="dBut"><asp:Button ID="Button1" runat="server" Text="Submit" OnClientClick="HideMe();" /></div>
function HideMe() {
var dw = document.getElementById("dwait");
var db = document.getElementById("dBut");
db.style.display = "none";
dw.style.display ="block";
}
When the asp.net button is clicked, it just hides the div of the button, or imagebutton (if you want) and shows the "wait" div. In the wait div you could put/style it however, like with an animated waiting or whatever... Enjoy!
Cool thing I found and broke it up for easy copy and use... Check out the code below and the links. Just grab the js and css files yourself off my server...
Take a look at the ImageFlow IPhone like Photo viewer you can view the source and get the goods, but below is the just of the code:
In the HEAD tag:
<link rel="stylesheet" href="imageflow.css" type="text/css" />
<script type='text/javascript' src='jquery.js?ver=1.3.2'></script>
<script type='text/javascript' src='jquery.cycle.js?ver=1.0'></script>
<script type='text/javascript' src='jquery.thumb-hover.js?ver=1.0'></script>
<script type='text/javascript' src='imageflow.js?ver=1.0'></script>
<script type="text/javascript">
jQuery(function($){
//sliding content
$('#image').cycle({
timeout: 5000,
fx: 'fade'
});
});
</script>
Then somewhere in the BODY TAG:
<div id="slider" class="imageflow">
<img src="images/1.jpg" width="600" height="450" alt="One" />
<img src="images/2.jpg" width="600" height="450" alt="Two" />
<img src="images/3.jpg" width="600" height="450" alt="Three" />
<img...
A new service was just release (BETA) for Florida county plat maps, Florida county plot maps, Florida county parcel boundary maps.
Really cool application. Check it out: Florida County Plat, Plot, Zoning, Parcel Boundary Maps
Technologies used: Google Earth Plugin, KML, Google Maps, Mobile device support for Android and iPhone platforms. Search the entire state of Florida for parcel boundaries, owner information, Google Street View, etc...
Facebook downgrade
Ok I had an issue with my new Blackberry curve and Facebook. The photo upload sucked! So I did some research and I found a post for version 1.5 of Blackberry Facebook software.
Version 1.5 is the version that worked!!! Here is a link to my zip file that worked. And here is the post. Note my zip file was for BB 4.5, not 4.6, BUT the post has both versions...
I did NOT write this, I wanted a javascript slidshow to show off project screen shots and found this code and wanted to make sure I had it in my archives to search for later! Got this off: http://www.javascriptkit.com/howto/show3.shtml
in head:
<script type="text/javascript">
<!--
//preload images
var image1=new Image()
image1.src="images/screenshot.jpg"
var image2=new Image()
image2.src="images/screenshot2.jpg"
var image3=new Image()
image3.src="images/screenshot3.jpg"
var image4=new Image()
image4.src="images/screenshot4.jpg"
//-->
</script>
In the body where you want the "images" to show up...
<a href="javascript:slidelink()">
<img src="images/screenshot.jpg" name="slide" border="0" width="492" height="354" /></a>
<script type="text/javascript">
<!--
var step=1
var whichimage=1
function slideit(){
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
whichimage=step
if (step<4)
step++
else
step=1
setTimeout("slideit()",4000)
}
slideit()
function slidelink(){
if (whichimage==1)
window.location="page1.html"
else if (whichimage==2)
window.location="page2.html"
else if (whichimage==3)
window.location="page3.html"
else if (whichimage==4)
window.location="page4.html"
}
//-->
</script>
Ok I needed a function that would select certain CheckBoxList items of an ASP.NET CheckBoxList, so here it is, hope is helps someone else out!
if you want I use this function hightlight the item in yellow:
function uStyle(cb) {
cb.parentNode.style.backgroundColor = cb.checked ? "yellow" : "";
cb.parentNode.style.color = cb.checked ? "blue" : "";
}
function doCertainOnes(cbControl) {
var chkBoxList = document.getElementById(cbControl);
var chkBoxCount = chkBoxList.getElementsByTagName("input");
chkBoxCount[5].checked = true;
chkBoxCount[5].focus(); //GOING TO JUMP DOWN IN THE LIST TO THE FIRST SELECTED
uStyle(chkBoxCount[5]);
chkBoxCount[6].checked = true;
uStyle(chkBoxCount[6]);
chkBoxCount[7].checked = true;
uStyle(chkBoxCount[7]);
for (var i = 10; i < 50; i++) {
chkBoxCount[i].checked = true;
uStyle(chkBoxCount[i]);
...
Great code I found for maxlength issue with .NET textboxes. .NET textboxes, if TextMode is set to MutilLine, the maxlength property just doesn't work, sux. So after playing around with different soloutions. I found this on, thanks to a guy named "Leo." So a big thanks to him!
Add this function in JavaScript on your page, I stuck it my "functions.js" file I include on the page anyway.
function checkMaxLen(txt,maxLen) {try{if(txt.value.length > (maxLen-1)) {var cont = txt.value;txt.value = cont.substring(0,(maxLen -1));return false;};}catch(e){}}
Then on the textbox use something like this:
<asp:TextBox runat="server" ID="txtComments" CssClass="comment_textbox" Height="75px" TextMode="MultiLine" onkeyup="return checkMaxLen(this,151)"></asp:TextBox>
Notice the function passes the textbox...