473,569 Members | 2,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1124
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?fra me=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
2152
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 datagrid. I am using the viewstate object to store the Arraylist items on the page on postback. My PROBLEM is that I need to redirect the user to...
3
2844
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 datagrid. I am using the viewstate object to store the Arraylist items on the page on postback. My PROBLEM is that I need to redirect the user to...
2
1381
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 component as I could in Java, VB6 or JavaScript in the folllowing manner : for (int x = 1; x < max;x++) { Form1.("textBox" + x.ToString()).Text =...
2
1274
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 standard textbox, and includes a variable that points to the monitoring tray control... it works just like the imagelist that is attached to any control...
6
3260
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 Page_Load() event <code> private void ConfigureFormControls() { Color borderColor = ColorTranslator.FromHtml("#F5F5F5"); Color fontColor ...
0
1242
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 empty rows I am dynamically loading a .ascx user control (it too being a gridview) multiple times each time it loads it renders different data. I...
3
5966
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 from the currently selected listview item. The dialog form is called FormEdit. How do I access the listview object on my main form the dialog form?...
2
1198
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 all other textbox.text are values which are stored in an object type array........... object obj = { textBox2.Text, textBox3.Text, textBox4.Text,...
3
1547
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 these newly generated <input type="text" id="..." /> elements with ASP.NET to save it to a database?
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
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...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
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...
0
3653
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...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.