473,394 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

TextBox control not accepting Information typed in..

I am a newbie. I have created a page which upon load connects to SQL
Server and runs a stored procedure. The data returned from this is
assigned to some asp:labels and asp:textbox controls.
This all works fine.
The user then updated the textbox controls and clicks an asp:button to
execute an event procedure. The event procedure is supposed to set some
session variables useing the information stored in the asp:textbox's
..Text property and call another webpage. Unfortunately, even though the
user has put information into the textbox, the .text property is
showing up as an empty string and that is what gets stored in the
Session Variable.
Why would this happen? How do I correct it?

Jul 16 '06 #1
3 1483
"Mad Bull" wrote ...
Why would this happen? How do I correct it?
Are you creating that text box programmitically in your code? If so,
perhaps this is happening regardless of a page postback, thus creating a new
control each time the page loads and therefore clearing any text that was in
it.

Regards

Rob
Jul 17 '06 #2

Rob Meade wrote:
"Mad Bull" wrote ...
Why would this happen? How do I correct it?

Are you creating that text box programmitically in your code? If so,
perhaps this is happening regardless of a page postback, thus creating a new
control each time the page loads and therefore clearing any text that was in
it.

Regards

Rob
Lets see... the textbox control is set up in the aspx page, like this:

<asp:textbox id="v_ExtDirAdLine" columns="1000" width="301px"
runat="server"></asp:textbox>

In the aspx.vb page, there is a definition for the textbox, like this:

Protected WithEvents v_ExtDirAdLine as
System.Web.UI.WebControls.TextBox

The above definition is at the class level, rather than being within a
procedure.

Thats all there is for definition. I do set the value of the textbox in
the page_load procedure, and then I type in a value. It seems the value
that is set in the page_load is always kept... that may be the reason.
I will put the initialisation code into an "If Not PostBack Then" block
and see what happens...

Yes that was it! Thanks much...

Jul 17 '06 #3
"Mad Bull" wrote ...
Yes that was it! Thanks much...
hehe, no worries :o)

Rob
Jul 20 '06 #4

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

Similar topics

10
by: mg | last post by:
I want to enter characters in a TextBox in a WebForm, press a Button in the WebForm, and read the characters that were typed into the TextBox from within the Button_Click event handler. The main...
9
by: Jerry | last post by:
In limiting textbox input to 500 characters I would like to include a dynamic count of characters input while the user is typing into a textbox. This would obviously be a client side control,...
2
by: Alex Shirley | last post by:
HI I'm trying to iterate through all the textboxes on a webpage and trim them for spaces. i.e. If a user enters " hello world " we correct it to "hello world" So far I've come up with...
8
by: Mark | last post by:
We have a multi-line textbox that users copy and paste email text into. The pasted text frequently will contain a tag like <blah@aol.com> or similar. I believe .NET is protecting itself from code...
1
by: Simon | last post by:
Hi I have a datagrid with a TemplateColumn where I have put inside a TextBox without databinding with the data source. The TextBox is used to type a number for each row of the datagrid. I have...
7
by: I am Sam | last post by:
I have a DataGrid that is passing information to a stored procedure properly but the parameters aren't being casted properly. I was woundering if anyone can tell me how I should properly cast the...
4
by: MattB | last post by:
Hi. I'm working on an intranet application that requires a user to input information about themselves. I have a user control with a couple of textboxes that I want the user to enter their weight...
3
by: DotNetNewbie | last post by:
I am reading the book Teach Yourself Microsoft Visual Basic .Net 2003 in 21 Days. I am having trouble getting one of the exercises to work at the end of day 4. Exercises: 1. Create a new...
2
by: Vbbeginner07 | last post by:
Hi all Wonder if anyone can help me out to solve this: please find the code of textbox that accepts only characters and one textbox that accepts only numbers: (vb) textbox for accepting...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...

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.