Weird problem

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
 
K

Karl Seguin

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
 
A

Arthur Hsu

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
 

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

Top