Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello!
i have a question i need to handle the click event of some element like a "td" my form get postbacked buy the event i registered for that event on server isnt fired.

i implemented the IPostBackEventHandler interface and implemented the RaisePostBackEvent as blow:

client code :
JavaScript
window.onload = function ()
{
    document.getElementById("TestTd").onclick = function (e)
    {
        __doPostBack("First args", "Second args");
    }
}

and code at server
C#
public void RaisePostBackEvent (string eventArgument)
    {
        this.InfoLabel.Text = "Handled";   
    }


as i said the form getts submitted but RaisePostBack method dosnt get executed.
thanks alot!
Posted
Updated 16-Apr-13 9:10am
v2
Comments
Richard C Bishop 16-Apr-13 15:05pm    
You failed to ask a question.

1 solution

__doPostBack('btnClick','Second args');
use below code at code behind
XML
if (Request["__EVENTTARGET"] == "btnClick")
{
   string secandArg = Request["__EVENTARGUMENT"];
}


try to avoid space for __EVENTTARGET ie btnClick, hope it will solve your problem
 
Share this answer
 

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