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

User Control Example wanted!

Does anyone know where I can find some example code of a user control that
contains dynamnically created text boxes of which the value can be retrieved
once the page has been submitted?

I think it's the OnInit process that I'm stuck on.

Thanks in advance,

Dunc
Nov 17 '05 #1
2 1931
I've created the control fine, it displays fine. The ID and the value are
set correctly. The only thing I can't do is read what value the user has
entered in any textboxes, etc after they've submitted the page that has my
user control built dynamically on.

Dunc

"Vincent V" <vincentv@-n0-5pam-optushome.com.au> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Maybe u can use ME.controls collection
dont know??

"Duncan Welch" <du**@ntpcl.f9.co.uk> wrote in message
news:OL**************@TK2MSFTNGP12.phx.gbl...
Does anyone know where I can find some example code of a user control that contains dynamnically created text boxes of which the value can be

retrieved
once the page has been submitted?

I think it's the OnInit process that I'm stuck on.

Thanks in advance,

Dunc


Nov 17 '05 #2
"Duncan Welch" <du**@ntpcl.f9.co.uk> wrote in message
news:#f**************@TK2MSFTNGP12.phx.gbl...
I've created the control fine, it displays fine. The ID and the value are
set correctly. The only thing I can't do is read what value the user has
entered in any textboxes, etc after they've submitted the page that has my
user control built dynamically on.


Make sure to recreate your dynamic controls during page_load
before reading the user input, because you can't read values
out of controls that are not there anymore.
Also make sure to use the same ID's again.

When you don't really need the controls again after postback,
still create them, but make them invisible.

--

Jos Branders
Nov 17 '05 #3

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

Similar topics

2
by: Timothy V | last post by:
Hi everyone, I hope you can help me. I have a User Control, which has a Label that covers the entire control. I want to assign a MouseClick event to the User Control, however, the event does not...
10
by: George G. | last post by:
Hi there, I am busy writing a new asp.net application and I am reusing some of my existing asp functions and methods in a user control. I need access to session, request and response in some of...
2
by: Jon Hyland | last post by:
This might be a dumb question, but what is the best way for one instance of a user control to access properties of an instance of another user control? For example, let's say I have an instance...
7
by: Tim | last post by:
I am trying to load both server and user controls into placeholder controls on a aspx template page at runtime. These values would be strings that are returned from a database query. I know I can...
6
by: guoqi zheng | last post by:
In a regular html form, when user press "enter" key, the form will be submitted. However, in ASP.NET web form, a form will only be submitted (post back) when a special button is clicked. Many...
3
by: James Ramaley | last post by:
I have created a VB.NET User Control which inherits from TextBox. I have a general question regarding how functionality should be overwritten: I can either write a method which handles an event:...
1
by: Anonieko | last post by:
I know Visual Studio lacked support on easily writing code to raise events from a ascx user control ( because you have to hand write them)....
4
by: tshad | last post by:
Is there a way for a User Control to access an object (such as label or textbox) on the .aspx page that calls it? For example: x.aspx ************************************** .... Sub...
1
by: Alec MacLean | last post by:
Hi, Outline of problem: I've built a set of user controls that are used to output questions for a survey and gather the responses using simple radio buttons. I'm adding an optional textbox...
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:
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...
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
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,...

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.