Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Events not firing in codebehind, WebControl designer problem

Reply
Thread Tools

Events not firing in codebehind, WebControl designer problem

 
 
kw
Guest
Posts: n/a
 
      07-12-2004
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!




 
Reply With Quote
 
 
 
 
kw
Guest
Posts: n/a
 
      07-12-2004
I forgot to add that the web control containing the multipage is loaded
dynamically...if that matters.
AssrSearch.Controls.Add(this.LoadControl(@"~\UI\Se archX.ascx"));


> 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!
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamically adding controls with events (but events are not firing) SevDer ASP .Net 2 11-13-2007 06:33 AM
WebControl Click Event Not Firing =?Utf-8?B?RGVtZXRyaQ==?= ASP .Net 0 01-05-2006 06:08 PM
Dynamically created webcontrol's events not firing Mark Rae ASP .Net 3 09-24-2005 02:16 PM
Events Events Events Please Help Chris ASP .Net Web Controls 0 08-30-2005 08:21 PM
WebControl inside of WebControl and attaching events Kasabaarde Sumta ASP .Net Building Controls 0 12-13-2004 09:51 PM



Advertisments