Menu

#27 TextBox OnBlur event

open
None
5
2007-09-18
2007-08-12
Anonymous
No

I have added a function to the TextBox for using "onblur" instead of "onchange" to track inputs when doing logins among other's stuff.
It Works Fine (making the callback) but, it dont get to fire the control_TextChanged() event (of course no text has been changed, and it mey be necessary to mimic it to fool the .net framework, or is there a possiblity to add an OnBlurr event to the Anthem.TextBox control to habdle this kind of AJAX Callbacks. This is very useful for me, and think for othér's

Andres Hohendahl

here is the code-stuff:

[DefaultValue(false)]
public bool AutoCallOnBlur
{
get {
if (null == ViewState["AutoCallOnBlur"])
return false;
else
return (bool)ViewState["AutoCallOnBlur"]; }
set { ViewState["AutoCallOnBlur"] = value; }
}
...
protected override void AddAttributesToRender(HtmlTextWriter writer)
{
if (AutoCallBack)
{
Anthem.Manager.AddScriptAttribute(
this, AutoCallOnBlur?"onblur":"onchange", Anthem.Manager.GetCallbackEventReference(
this,
... the rest is the same..

Discussion

  • Andy Miller

    Andy Miller - 2007-09-18

    Logged In: YES
    user_id=1245761
    Originator: NO

    This does sound useful. Please feel free to contribute a control to AnthemExtensions (just attach the complete control to this patch).

     
  • Andy Miller

    Andy Miller - 2007-09-18
    • assigned_to: nobody --> psiegers
     

Log in to post a comment.