Riddle me this... RBL strikes again. Min USENET clue reveals noth

M

Michael Conroy

Slap a radiobuttonlist on the screen with a textbox and a button. Change the
order of the RBL and textbox and suddenly viewstate and event handling goes
away. Swap 'em back and all is well. This ready to run code snippet
demonstrates the behavior.

Does ANYBODY have any idea why this is...and more importantly, what I can do
about it? Is this a bug, my own lack of sleep, or a "forest for the trees"
problem.

Cheers,
M.

<%@ Page Language="C#" EnableSessionState="True" Trace="True" %>
<HTML>
<HEAD>
<script runat="Server" language="C#">
protected void Page_Load(object sender, System.EventArgs e)
{
this.m_rbList.SelectedIndexChanged += new
System.EventHandler(this.m_rbList_SelectedIndexChanged);

if(!this.IsPostBack)
{
for(int i=0;i<5;i++)
{
m_rbList.Items.Add("Choice " + i.ToString());
}
}
}

private void m_rbList_SelectedIndexChanged(object sender,
System.EventArgs e)
{
if(m_rbList.SelectedIndex>-1)
this.m_btnNext.Enabled=true;
else
this.m_btnNext.Enabled=false;
}

</script>
</HEAD>
<body style="FONT: 10pt verdana">
<form runat="Server" id="Form1">
<!-- THIS WORKS
<asp:RadioButtonList id="Xm_rbList" runat="server"
AutoPostBack="True"></asp:RadioButtonList>
<asp:Textbox value="TextBox/RadioButton Mystery"
id="XtxtName" runat="Server" ></asp:Textbox> -->

<!-- THIS DOESN'T!!!!!
<asp:Textbox value="TextBox/RadioButton Mystery"
id="ytxtName" runat="Server" ></asp:Textbox>
<asp:RadioButtonList id="ym_rbList" runat="server"
AutoPostBack="True"></asp:RadioButtonList> -->

<asp:Button id="m_btnNext" runat="server" Text="Next"
Enabled="False"></asp:Button></P>
<asp:RadioButtonList id="m_rbList" runat="server"
AutoPostBack="True"></asp:RadioButtonList>
<asp:Textbox value="TextBox/RadioButton Mystery"
id="txtName" runat="Server" ></asp:Textbox>

</FORM>
</body>
</HTML>
 
M

Michael Conroy

OK... so replicating this with a blank .Net webApp yields perfectly
acceptable behavior... so, I should amend that this occurs when using the MS
Web Browser control inside an app hosting the ASP.NET runtime.

Any takers now? :)
 
A

Alvin Bruney [MVP]

Any takers now? :)
sure. i'm always a sucker for that kinda thing.

I copied and pasted your code. Ran it. It behaved correctly, that is, i
don't see the error you are talking about


--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://www.lulu.com/owc
 
M

Michael Conroy

Of course... :(

I did the same thing with a simple WebApplication1 project. Works fine.
What I'm seeing is the result of hosting the ASP.NET runtime ala Rick
Strahl's article...

http://www.west-wind.com/presentations/aspnetruntime/aspnetruntime.asp

Great article - and he's been very helpful. I was able to replicate the
problem using his sample code... so I suspect the issue lies somewhere in his
implementation. All the source is there, but I don't know that much about
browser mechanics, so I'm not really sure how to go about debugging things.
I've tracked through the post buffer and it really looks fine, so maybe it's
an idiosyncracy with the Microsoft Web Browser control? I just don't know...

Thanks for responding... and if you have any other suggestions for making a
pretty HTML style UI, feel free... :)

Best,
M.


Alvin Bruney said:
Any takers now? :)
sure. i'm always a sucker for that kinda thing.

I copied and pasted your code. Ran it. It behaved correctly, that is, i
don't see the error you are talking about


--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://www.lulu.com/owc
----------------------------------------------------------


Michael Conroy said:
OK... so replicating this with a blank .Net webApp yields perfectly
acceptable behavior... so, I should amend that this occurs when using the
MS
Web Browser control inside an app hosting the ASP.NET runtime.

Any takers now? :)
 

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

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top