Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Looking For C#/ASP.NET Help
RE: Looking For C#/ASP.NET Help
#4
Since it's server side, you should probably still use an ASP button, and yes, server side completely nixed my proposed solution. 

Is the control added dynamically to the page, or is it static? Dynamically added controls do not necessarily have the same ID each time they're instantiated, so if it varies from one postback to the next, then the event handler won't execute. If the control is instantiated outside of the page's Page_PreInit or Page_Init, you likely won't have any saved viewstate values from the postback. You also need to set the event handler each time if the control itself raises an event for the page to handle. If static, then I have no idea why the event handler isn't firing. Also, the Page_Load event (for the page, then the controls) will always run to completion before any event handlers are called.

I've got a couple projects with user controls in them, and none of them implement IPostBackEventHandler.
Reply


Messages In This Thread
Looking For C#/ASP.NET Help - by Bob Schroeck - 11-06-2017, 03:25 PM
RE: Looking For C#/ASP.NET Help - by NifT - 11-07-2017, 03:19 PM
RE: Looking For C#/ASP.NET Help - by Bob Schroeck - 11-07-2017, 04:35 PM
RE: Looking For C#/ASP.NET Help - by NifT - 11-07-2017, 07:10 PM
RE: Looking For C#/ASP.NET Help - by Bob Schroeck - 11-08-2017, 08:07 AM
RE: Looking For C#/ASP.NET Help - by Bob Schroeck - 11-09-2017, 01:27 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)