CallBack problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JimWu
    New Member
    • Aug 2007
    • 14

    CallBack problem

    Hi,
    I would like to do callback approach.
    But I face some problem while calling different Javascript function.

    I have no idea to make two different Javascript function to work.

    For example, a function as follow
    Code:
    string strScript = "function ReceiveServerData(arg, context){ document.getElementById('" + result.ClientID + "').value = arg + ' ' + context + document.getElementById('"+ num1.ClientID +"').value; }";
    
    Page.ClientScript.RegisterClientScriptBlock(this.GetType), "myscript", strScript, true);
    
    string cbReference = Page.ClientScript.GetCallbackEventReference(this, "''", "ReceiveServerData", "'222'");
    
    [B]Button2.[/B]Attributes.Add("onclick", cbReference);
    anothor as follows

    Code:
    string addItem = "function receiveData(arg, context){}";
    
     Page.ClientScript.RegisterClientScriptBlock(this.GetType), "addScript", addItem, true);
    
     string test = Page.ClientScript.GetCallbackEventReference(this, "''", "receiveData", "'555'");
    
    [B]Button3.[/B]Attributes.Add("onclick", test);
    Now, I want two different buttons(Button2 and Button3) onclick event to do somthing, but i do not know how to implement my RaiseCallbackEv ent method and GetCallbackResu lt method.

    Using one Javascript function is Ok that only write code on RaiseCallbackEv ent method and GetCallbackResu lt method.

    Is this callback bottleneck for only one Javascript function?

    Could anyone answer my problem.

    Thanks for any kindly assistance.

    Jim.
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    moved to javascript forum. if this isn't a javascript issue it might be a .NET issue, I'm not really sure.

    Jared, moderator
    ASP forum

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Originally posted by jhardman
      moved to javascript forum. if this isn't a javascript issue it might be a .NET issue, I'm not really sure.
      More likely to get help in .NET. Moved to .NET forum.

      Comment

      Working...