I've written an ASP.NET server control. It inherits from WebControl and implements IPostBackEventHandler. To implement IPostBackEventHandler, the RaisePostBackEvent method needs to be implemented. Now for some strange reason my eventArgument parameter is always null. Even if in my HTML source the correct __doPostBack script function is called.
Here's a simple workaround if anyone has the same problem. In your RaisePostBackEvent method, add the following code...
string evtArg = null;
if (eventArgument == null)
{
if (Page.Request.Form["__EVENTTARGET"] == this.UniqueID)
{
evtArg = Page.Request.Form["__EVENTARGUMENT"];
}
}
From here, use evtArg instead of eventArgument.