473,386 Members | 1,654 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,386 software developers and data experts.

accessing textboxes

Hi, I have an aspx page with some asp:textboxes. In Page_load, I can populate
the textboxes, I have a button on the page, clicking the button generates the
btton_click event.
My proble is I am not able to access the values as textbox.text in this event.
I am detting nothing as if I can not see those textbox objects. I can have
the text in thme by using request.params("mytextbox")
Tha&nks for your help

Nov 19 '05 #1
5 1115
Can we see some summary code? Something tells me the Page_Load is
messing with / changing the values on PostBack. How about your
Page_load and btton_click event handlers...
Cheers,
Daniel
http://www.danhendricks.com

Nov 19 '05 #2
Hi Eliassal,

From your description, in your page's Button click event , you can't get
the TExtBox controls' reference( but can reference them in Page_load), yes?

I'm not sure whether there is anything incorrect in your page's codebehind
file. But I also recommedn that you provide a simple repro page so that we
can do some test on our local side. Also, what language are you using (c#
or vbnet), if you need I can also provide a simple test page so that you
can have a try on your side.

Please feel free to let me know if you need any further assistance. 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
Thanks for your help, you were both correct. It was a problem in the ispostback

I h
Thanks
salam

"SalamElias" wrote:
Hi, I have an aspx page with some asp:textboxes. In Page_load, I can populate
the textboxes, I have a button on the page, clicking the button generates the
btton_click event.
My proble is I am not able to access the values as textbox.text in this event.
I am detting nothing as if I can not see those textbox objects. I can have
the text in thme by using request.params("mytextbox")
Tha&nks for your help

Nov 19 '05 #4
Bu mistake, I clicked on send, so I had
Sub Page_load
If not Page.Ispostback
do something
End if
textbox.text = myob.value
end sub
I put textbox.text = myob.value inside the if and it works fine. Is there an
article about the life cycle or an example in msdn that allows to see
practically what is executed (successive events) before arriving to the
button_click event ?
Thanks again
"SalamElias" wrote:
Hi, I have an aspx page with some asp:textboxes. In Page_load, I can populate
the textboxes, I have a button on the page, clicking the button generates the
btton_click event.
My proble is I am not able to access the values as textbox.text in this event.
I am detting nothing as if I can not see those textbox objects. I can have
the text in thme by using request.params("mytextbox")
Tha&nks for your help

Nov 19 '05 #5
Hi Eliassal,

Of course, there are some good ones which can help explaining the asp.net
server control's life cycle( event exection sequence). Here are some:

#Control Execution Lifecycle
http://msdn.microsoft.com/library/en...rolExecutionLi
fecycle.asp?frame=true

#Understanding ASP.NET View State
http://msdn.microsoft.com/library/en...asp?frame=true

#The ASP.NET Page Object Model
http://msdn.microsoft.com/library/en...eobjectmodel.a
sp?frame=true

If you found anything unclear, please feel free to post here.
Enjoy them.

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 #6

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

Similar topics

11
by: Stephen | last post by:
I was wondering if someone can help me with an web application design problem. I have a aspx page which builds up an arraylist called addresses and outputs the values in the arraylist items to a...
3
by: Stephen | last post by:
I was wondering if someone can help me with an web application design problem. I have a aspx page which builds up an arraylist called addresses and outputs the values in the arraylist items to a...
2
by: Bluelace | last post by:
I have a screen which has as number of textboxes on a screen which I wish to initialise using a loop. The textboxes are named textBox1, textBox2 etc. I hoped I hoped that I could address the...
2
by: Robert Kemp | last post by:
I am creating a non-visible/tray control that monitors other custom controls for changes (among other things). One of the monitored controls is a new textbox that adds functionality to the...
6
by: Steve | last post by:
I'm trying to iterate over all the form controls in my MasterPages content page. Basically, I've got dropdowns, textboxes, etc that I want to format in Page_Load() I've added this code to my...
0
by: erkbiz | last post by:
Hello, this is my first post, I hope this is the right forum to ask my question. I am dynamically loading a user control multiple times. I have a gridview and have inserted empty rows. Into these...
3
by: markliam | last post by:
I have a form with a listview and an edit button named Form1. When the edit button is clicked, a dialog box containing some textboxes should appear and the textboxes should be filled with data...
2
by: gurmeet07 | last post by:
hey guys i m new to .net and facing one problem on click of a button (saving the data to the hash table) like this : there are 7 textboxes and first textbox1.text is the key for hash table n...
3
by: jeroen.bolle | last post by:
I'm designing a form where the user can decide how many options for a poll he wants to add. There's a "+" button to dynamically add textboxes with javascript, without a postback. How do I access...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.