Willem Odendaal

the coder's point of view

<November 2008>
SuMoTuWeThFrSa
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456


Navigation

I Read

Subscriptions

Post Categories



Monday, February 21, 2005 - Posts

RaisePostBackEvent eventArgument always null

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.

posted Monday, February 21, 2005 7:11 AM by willemo




Powered by Dot Net Junkies, by Telligent Systems