Events not firing in codebehind, WebControl designer problem

K

kw

I have a Microsoft.Web.UI.WebControls.TabStrip and a
Microsoft.Web.UI.WebControls.MultiPage. On the MultiPage are a few
pageviews. On each pageview is a System.Web.UI.WebControls.LinkButton.

Because the LinkButton's are inside the MultiPage, they don't appear in
codebehind. So I added them manually, ie:

protected System.Web.UI.WebControls.LinkButton _SearchByX;
and added:



private void InitializeComponent(){
this.Load += new System.EventHandler(this.Page_Load);
this._SearchByX.Click+=new EventHandler(_SearchByX_Click);

and finally:

private void _SearchByX_Click(object sender, EventArgs e){
Debug.Writeline("event fired");

So, I run the web app and go to the form containing this usercontrol. I
click on the 'Search' button (_SearchByX) and neither the page load fires
nor the event.

Any clues why this happens?



Thanks!
 
K

kw

I forgot to add that the web control containing the multipage is loaded
dynamically...if that matters.
AssrSearch.Controls.Add(this.LoadControl(@"~\UI\SearchX.ascx"));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top