When upon checking, all you see that's available is a TextChanged event. And you know that the html input tag can support other events like:
A workaround is to create an ASP.NET Button and place it inside a hidden div:
<div style="display: none;">
<asp:Button ID="btnTextBoxEventHandler" runat="server"
OnClick="btnTextBoxEventHandler_Click" />
</div>
And here's the markup for the textbox, just a regular one:
<asp:Textbox ID="txt1" runat="server" />
Now on your page onload event, add an attribute to your textbox:
protected void Page_Load(object sender, EventArgs e)
{
txt1.Attributes.Add("onblur", this.Page.ClientScript.GetPostBackEventReference(this.btnTextBoxEventHandler, ""));
}
Then of course, the event handler for the button:
protected void btnTextBoxEventHandler_Click(object sender, EventArgs e)
{
//Place code here for onblur..
}
Now place the code you want to trigger (when the textbox loses focus) inside the button event and see what happens. Try experimenting with other event attributes and ASP.NET control combinations too.
-k
v r using onblur for the txt box validation ... after focus comes out from the txt box it should auto check the conduction with out click any button .........
ReplyDeleteThanks alot. Really useful code.
ReplyDeleteperfect. Absolutely helped me:).
ReplyDeleteGracias, excelente me sirvió al primer intento, saludos.
ReplyDeletenice one.......
ReplyDeleteThank you, I have wasted hours trying to get ASP.Net and Java to play nice.
ReplyDeleteI am new to both so naturally thought I was the problem.
works like magic
ReplyDeletethank you very much!!!
your the man!
ReplyDeletethanks man !! your logic worked smoothly...
ReplyDeletei was searching a way to calculate amount and tax on change event.. This works perfectly..
Excellent.. Thanks
ReplyDeletePrasad KM