strange behaviour in UserControl
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > strange behaviour in UserControl




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    strange behaviour in UserControl  
Charles Bell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-26-04 10:48 PM

Hi Folks,

I've come across some strange behaviour in a UserControl. Basically, I've
added a standard Web user control to a CMS template (it just allows the user
to select info from a database that sits on the same server - kind of
integrating CMS with an external app).

So, I have two repeaters (to list the first letters of the external data)
and two buttons.

Here's some code:

this.rpLetters.ItemCommand += new
System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rpLetters_ItemCom
mand);


this.rp2Letters.ItemCommand += new
System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rp2Letters_ItemCo
mmand);


this.cmdSubmit.Click +=new EventHandler(cmdSubmit_Click);

this.cmdReset.Click +=new EventHandler(cmdReset_Click);

Now, the first two items - repeater item commands - cause explicit postbacks
via the javascript:__doPostback(...) calls.

But the cmdSubmit and cmdReset don't do anything - clicking the button gives
no response. These commands are in the Page_Load block of my UserControl and
I can step through the code to confirm that they're being executed (the fact
that the repeater itemcommands are working is proof of that).

Any ideas?

The usercontrol is in a CMS aspx template file.







[ Post a follow-up to this message ]



    Re: strange behaviour in UserControl  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-26-04 10:48 PM

Hi Charles,

did you set a break point in the cmdSubmit_Click routine to see if it gets
fired?

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

MCMS FAQ:
http://download.microsoft.com/downl...>
MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...nagement+Server
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------


"Charles Bell" <charlie@bang.co.uk> wrote in message
news:OvD36G4uEHA.2804@TK2MSFTNGP14.phx.gbl...
> Hi Folks,
>
> I've come across some strange behaviour in a UserControl. Basically, I've
> added a standard Web user control to a CMS template (it just allows the
user
> to select info from a database that sits on the same server - kind of
> integrating CMS with an external app).
>
> So, I have two repeaters (to list the first letters of the external data)
> and two buttons.
>
> Here's some code:
>
> this.rpLetters.ItemCommand += new
>
System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rpLetters_ItemCom
mand);
>
>
> this.rp2Letters.ItemCommand += new
>
System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rp2Letters_ItemCo
mmand);
>
>
> this.cmdSubmit.Click +=new EventHandler(cmdSubmit_Click);
>
> this.cmdReset.Click +=new EventHandler(cmdReset_Click);
>
> Now, the first two items - repeater item commands - cause explicit
postbacks
> via the Java script:__doPostback(...) calls.
>
> But the cmdSubmit and cmdReset don't do anything - clicking the button
gives
> no response. These commands are in the Page_Load block of my UserControl
and
> I can step through the code to confirm that they're being executed (the
fact
> that the repeater itemcommands are working is proof of that).
>
> Any ideas?
>
> The usercontrol is in a CMS aspx template file.
>
>







[ Post a follow-up to this message ]



    Re: strange behaviour in UserControl  
Charles Bell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-26-04 10:48 PM

Yes - and it doesn't get fired.

It's REALLY strange because I have other UserControls with buttons in them
and they fire alright. I was wondering if there was anything obvious that
I'm missing.

"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
news:OlW4$O4uEHA.944@TK2MSFTNGP11.phx.gbl...
> Hi Charles,
>
> did you set a break point in the cmdSubmit_Click routine to see if it gets
> fired?
>
> Cheers,
> Stefan.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> MCMS FAQ:
> http://download.microsoft.com/downl...
a/MCMS+2002+-+(complete)+FAQ.htm
> MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
> MCMS Sample Code:
> http://www.gotdotnet.com/community/...nagement+Server
> MCMS Whitepapers and other docs:
> http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
> --------------------------------
>
>
> "Charles Bell" <charlie@bang.co.uk> wrote in message
> news:OvD36G4uEHA.2804@TK2MSFTNGP14.phx.gbl... 
> user 
> System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rpLetters_ItemC
om
> mand); 
> System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rp2Letters_Item
Co
> mmand); 
> postbacks 
> gives 
> and 
> fact 
>
>







[ Post a follow-up to this message ]



    Re: strange behaviour in UserControl  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-26-04 10:48 PM

Hi Charles,

sounds more like an ASP.NET problem than a MCMS problem. Actually templates
are nothing but special web forms.
You should post this question to an ASP.NET related newsgroup.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

MCMS FAQ:
http://download.microsoft.com/downl...>
MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...nagement+Server
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------


"Charles Bell" <charlie@bang.co.uk> wrote in message
news:OLmdaf4uEHA.3840@TK2MSFTNGP12.phx.gbl...
> Yes - and it doesn't get fired.
>
> It's REALLY strange because I have other UserControls with buttons in them
> and they fire alright. I was wondering if there was anything obvious that
> I'm missing.
>
> "Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
> news:OlW4$O4uEHA.944@TK2MSFTNGP11.phx.gbl... 
gets[vbcol=seagreen] 
http://download.microsoft.com/downl...
+Server[vbcol=seagreen] 
I've[vbcol=seagreen] 
data)[vbcol=seagreen] 
System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rpLetters_ItemCom[vbcol=seagreen]
 
System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rp2Letters_ItemCo[vbcol=seagreen]
 
UserControl[vbcol=seagreen] 
>
>







[ Post a follow-up to this message ]



    Re: strange behaviour in UserControl  
Charles Bell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-26-04 10:48 PM

Thanks Stefan - after a bit of digging, I found the problem. It was indeed
an ASP.NET issue - it was caused by a rogue <form> block inside the
UserControl overriding the external <form runat=server> block..

I had this issue once before about a week ago and I posted the solution on
this group.

So, once is forgivable, twice is stupidity. If I write back on this group
with the same problem again, you have my permission to punch me. ;-)


"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
news:OpIflj4uEHA.3152@TK2MSFTNGP14.phx.gbl...
> Hi Charles,
>
> sounds more like an ASP.NET problem than a MCMS problem. Actually
> templates
> are nothing but special web forms.
> You should post this question to an ASP.NET related newsgroup.
>
> Cheers,
> Stefan.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> MCMS FAQ:
> http://download.microsoft.com/downl...
a/MCMS+2002+-+(complete)+FAQ.htm
> MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
> MCMS Sample Code:
> http://www.gotdotnet.com/community/...nagement+Server
> MCMS Whitepapers and other docs:
> http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
> --------------------------------
>
>
> "Charles Bell" <charlie@bang.co.uk> wrote in message
> news:OLmdaf4uEHA.3840@TK2MSFTNGP12.phx.gbl... 
> gets 
> http://download.microsoft.com/downl...
a/MCMS+2002+-+(complete)+FAQ.htm 
> http://www.gotdotnet.com/community/...nagement+Server 
> I've 
> data) 
> System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rpLetters_ItemC
om 
> System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rp2Letters_Item
Co 
> UserControl 
>
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:18 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register