Saturday, March 24, 2012

Ajax Textbox Issue

Hi,

I have created a ASp .NET 2.0 Ajax enabled Website. I have two textbox controls on the default page. These controls are added to the UpdatePanel. What I want is, when the first textbox looses focus and moves to textbox2 the datetime should automatically get added to the first textbox.

All I find is the serverchange event of the first textbox. An article on web should that it can be done through onblur but since the textbox control is a server side control, I think onblur will not work.

Please help!!

Thank You,

~B.

You can add onblur in the code behind file if you do something like TextBox1.Attributes.Add("onblur","dothis();");


onblur, onfocus, etc. will work with the server controls. You can also add them right in source view, though the Visual Studio IDE may tell you that they are not supported attributes.


You can use onblur or lostfocus event

TextBox.Attributes.Add("onblur","functionName()");

TextBox.Attributes.Add("lostfocus","functionName()");

No comments:

Post a Comment