472,348 Members | 1,244 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Dynamically creating a web form with server controls

I want to define a set of web-form templates in XML and render the equivalent
web-form with ASP.NET, then process any input server controls on the form.

Reading the XML file from Page_load is easy, but
1) How do I set about dynamically creating user controls (like TextBox,
TextArea)
--- simply Declare and initialised (new) the user controls?? How do I
"place" it graphically on the form. Ideally, I want them to lay out in a
table, one by one.

2) How do I wire up the user controls to page submission handling?
Nov 19 '05 #1
2 4426
Hi,

We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 19 '05 #2
Hi,

From your description, you have defined a certain XML template which
contains the info of how a webform page's layout(webcontrols on the page )
are included and positioned, and you're wondering how to correctly add
those configured controls dynamically onto the webform page, yes?

As for this question, this is a typical "programmatically creating and
adding web server controls onto page" problem. Generally we should take
care on the following things when adding dynamic controls onto page:

1. As for creating , it'll be better if we can create those dynamic
controls in Init event though Page_load is also ok. And the most important
thing is that we need to create the controls in every request (not only the
intial request like IsPostBack==true)

2. For postback event handler for dynamic created controls, we also need
to add them everytime the page is executed. Also, we need to put the event
handler registering code before the page's post back event happending
(generally in page_init or Page_Load is ok)

Anyway, if you're not very familiar with the ASP.NET's page processing
model(events and viewstate mechanism....), I suggest you have a look at the
following tech articles which may help us have a more detail idea on the
problems we may meet when creating dynamic webpage UI:

#Creating Dynamic Data Entry User Interfaces
http://msdn.microsoft.com/library/en...asp?frame=true

#Understanding ASP.NET View State
http://msdn.microsoft.com/library/en.../viewstate.asp

#HOW TO: Dynamically Create Controls in ASP.NET by Using Visual C# .NET
http://support.microsoft.com/default...b;en-us;317794

If there're any further problems, please feel free to post here. Thanks,

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

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

Similar topics

4
by: Bas Groeneveld | last post by:
I am developing an ASP.NET application part of which consists of a data entry wizard defined by entries in a data table - ie the controls on each...
1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am have facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My...
1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My...
2
by: Chad | last post by:
I have a problem that I am desperate to understand. It involves dynamically adding controls to a Table control that is built as a result of...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user...
5
by: Dennis Fazekas | last post by:
Greetings, I am creating a web form which will all the user to add an unlimited number of email addresses. Basically I have 3 buttons, "Add...
3
by: Dotnet Gruven | last post by:
I've built a WebForm with a Table added dynamically in Page_Load when IsPostBack is false. The table includes a couple of TextBoxes,...
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel...
7
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

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.