Weird problem

  • Thread starter Thread starter Arthur Hsu
  • Start date Start date
A

Arthur Hsu

Hello,

I have an ASP.NET page with a form

<form id="myform" method="post" runat="server">
<asp:panel id="pnl1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute;
TOP: 8px" runat="server"
Height="572px" Width="360px">
<asp:button id="cmdSubmit" runat="server" Text="Submit"></asp:button>
</asp:panel>
<asp:panel id="pnl2" style="Z-INDEX: 103; LEFT: 8px; POSITION: absolute;
TOP: 592px"
runat="server" Height="152px" Width="360px">
<asp:TextBox id="txt" runat="server"></asp:TextBox>
</asp:panel>

On the code-behind C# file, I intercept the cmdSubmit.Click event:

private void cmdSubmit_Click(object sender, System.EventArgs e)
{
string s = txt.Text;
}


However, txt.Text always return "" no matter what I have input in the text
box. How can I fix that?

TIA,

Arthur
 
Works fine for me. If you are just doing a Response.Write(s), the text will
show up behind the button and you won't see it *chuckle*

Karl
 
I found out the possible reason. The machine has hardware defects. Its
hard drive is dead today, and the memory is also bad.
On the replacement machine I got no problem at all.

Still thanks for you guys' help.

-Arthur
 
Back
Top