Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
i need to add onblur client event for an asp text box where it is only available for html controls. Is it possible to add such a event to an asp control text box instead of giving runatserver to an html control .
thanks in advance
Posted

XML
<asp:TextBox ID="txtdob" runat="server" onblur="if(this.value!=''){somefunction(this.value)};" MaxLength="10" Width="75px"></asp:TextBox>
 
Share this answer
 
You can add any attribute to the markup.
 
Share this answer
 
use like this...
<asp:TextBox id="txtId" runat="sever"></asp:TextBox>

in code behind page

page_load{
this.txtId.Attributes.add("onblur","javascript:funBlur();");

}
 
Share this answer
 
v2
Comments
[no name] 22-Feb-12 7:57am    
Code-behind is not necessary

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900