473,831 Members | 2,197 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Weird problem

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.EventArg s 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
Nov 19 '05 #1
3 1543
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Arthur Hsu" <ah**@vimatech. com> wrote in message
news:Oo******** ******@TK2MSFTN GP12.phx.gbl...
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.EventArg s 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

Nov 19 '05 #2
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

"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:S6******** ******@cpmsftng xa10.phx.gbl...
Hi Arthur,

From your description ,you can't get a TextBox's new inputed values in a
Button's Click event. I'm not sure on your complete page content and code
behind file but I don't think this will be a big problem. Maybe we just
miss somethings in the codebehind or ... I've attached a simple test
page
in this message, you can have a try on your side to verify whether there
is
anything different in your page.
If you have any other questions, please feel free to let me know. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #3
You're welcome Arthur,

Good luck!

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2082
by: redneck_kiwi | last post by:
Hi all: I have a really weird problem. I am developing a customer catalog system for my company and as such have delved into sessions for authentication and access levels. So far, I have managed to get a working system just about finished. I am building an interface for our customer service folks to use to manage registered customers and am seeing some weird behavior.
13
3812
by: Wolfgang Kaml | last post by:
Hello All, I have been researching newsgroups and knowledgebase all morning and not found a solution that would solve the problem I have. I am having an ASP or ASPX web page that implement a counter functionality and read/insert some data in a MS Access database on that Windows 2003 server. The weird part is, as long as the web page is very short in size, I can hit the refresh button and Internet Explorer will reload the page and display...
1
2108
by: Kaneda | last post by:
Hello everyone! I have some weird(?) problems, and I am not quite sure if there are due to my errors or maybe a limitation in the .Net framework. I have a ComboBox I need to fill with the content of an untyped DataSet. This is to be done in the "DropDown" Event (since the dataset is empty at program start). If I go with this:
0
1162
by: Kaneda | last post by:
Hello everyone! I have some weird(?) problems, and I am not quite sure if there are due to my errors or maybe a limitation in the .Net framework. I have a ComboBox I need to fill with the content of an untyped DataSet. This is to be done in the "DropDown" Event (since the dataset is empty at program start). If I go with this:
6
1417
by: Unicorn | last post by:
I can only say this is a weird problem! I will be sitting there typing away in the code window, when the whole IDE just vanishes without a trace. I get no error messages and no indication, it is just gone. One second I am typing in the IDE and the next I am in whatever application was behind it on the desktop and my keystroke are going to that active application. There is nothing in the application or security logs to indicate...
1
1534
by: Jeffrey Melloy | last post by:
I recently noticed that in my web app, a \n wasn't getting converted to a <br />. (The problem turned out to be that for this particular record, it was a \r). When I checked out the record in psql, I got some weird behavior. What shows up in the web: amoth4:it is o.o jm:Speaking of being a sounding board, will you test something? jm:Ot
0
1454
by: Zwyatt | last post by:
having a really weird little bug w/ time_t...check it out: I have the following code (simplified here): #include <time.h> class A { public: char *aString; int aNum;
1
1554
by: Strange Cat | last post by:
Hi everyone! I have a weird problem with FormsAuthentication. I have an app that works just fine with FormsAuthentication. The user requests the homepage, he is redirected to login page, then enters valid username and password that are checked versus a db table, if the info is ok i execute SetAuthCookie(xxx, False) then i open a new window which displays the home page, all is working fine...
3
5492
by: aling | last post by:
Execute following T-SQL within Queary Analyzer of SQL Server 2000: ======================================= DECLARE @dTest DATETIME SET @dTest='2001-1-1 1:1:1:991' SELECT @dTest SET @dTest='2001-1-1 1:1:1:997' SELECT @dTest
0
1836
by: P Pulkkinen | last post by:
Dear all, sorry, i know this code is far little too long to debug here, but there is really annoying logical error. If someone debugs this, I really offer warm virtual handshake. What this code SHOULD do: - read new (=updated) licensetext from file $license_path then - read and modify recursively all files from $current_dir, replacing old
0
9793
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10493
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10206
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7747
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5617
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5780
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3960
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3076
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.