Tim Maxey .NET Technology Blog & Resources
VB.NET Code
Posts about VB 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!
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...
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]);
...
Ok it is NEVER a good idea to store a cookie on a client's machine with an ID or username and password in the cookie. Can steal the cookie. Come on, cookies are good to eat, chocolate chip cookies are my fav! Anyway, take a look at this, I think joomla does this and I don't take all the credit, but this works great:
1. Obviously a login.aspx page with a checkbox to save my login.
2. Evertime the user is logged in, either themselves or through the cookie, it deletes the old one in the table and writes a new one...
Hi there guys, had an issue with WebForm_DoPostBackWithOptions vs __doPostback. WebForm_DoPostBackWithOptions started showing up on a page and not showing up on other .NET pages. It was a pain in my butt! Because WebForm_DoPostBackWithOptions wasn't working, all my linkbutton had this javascript function rendered and none of the events were firing!
So after looking around I found out that I had some panels that were hidden on the page. And in one of those panels, I have a validation control, if a validation control is "hidden" on the page (the panel's visibility is set to false and later made visible) then...
My webservice call to, example: service1.asmx/myfunction just wasn't working on the server, but on my local box it worked great, so I had to add entries in the web config...
This needs to go between your <system.web> tags in the web.config
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
I needed to display the age of of a birthday field from a database. I was so tired of coding and came across this function!
I got this from a guy named "hans" on a forum, great little function I didn't have to write!
Private Function Age(ByVal Birthday As DateTime) As Integer
Dim year As Integer = Today.Year - Birthday.Year
If Today.Month < Birthday.Month Or (Today.Month = Birthday.Month And Today.Day < Birthday.Day) Then
Return year - 1
Else
Return year
End If
End Function
I had an ANNOYING problem with Visual Studio 2008 and the AjaxControlToolkit.dll. Seemed like if I had an Update Panel on the aspx age, I would get asked if I wanted to replace the AjaxControlToolkit.dll. ANNNOYING, so I did some searching and finally did this:
1. In VS 2008 I had to right click on the toolbar and choose the option "choose items," then I sorted the the .NET Framework Components and unchecked the AjaxControlToolkit version version 3.0.1xxx and keep the 3.0.2xxx.
2. Next I went to the property page of the project and references and removed the AjaxControlToolkit reference, then 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...
I went to an interview and basically ended up telling the guy that the company was not for me. But I did learn something:
I found out how to track an email being opened, pretty cool trick, ready for this awesome trick?
When the email gets created in an app, a small 1px img is saved on the server, a guid.gif, transparent gif. guid meaning like der35d288d5jsk32.gif
This gif is added to the email address and when the email is opened, the gif is pulled from the server, and on the server the folder has a listener and when that gif is requested...
Full VB.NET Code Archive