Java Mailing List Archive

http://www.junlu.com/

Subjects
Home
mod jk2 https
Donation of JAXP 1 3 Sources to Apache
R annoyances
RE: Finding out when the aspnet admin worker process has recycled
Favorite Linux Distribution
eigenvalues of a circulant matrix
Apache Install
Reachin apache from outside
Ant should have an ext directory
Warning: Documentroot doesn 't exist
Can this be Done?
RE: Multilanguage Application
RE: Simple Question On setting up Sub Domain site
Lack of independence in anova()
How to close connection instead of sending 403?
winning the case for ANT
Re: adding php
New Ant GUI 'Ant 's Nest '
Narrowing Down A Strange Problem
Ant Task: sshexec
R Graph Gallery : categorization of the graphs
I 've been hacked, I need some help please
RE: Anyone working with DotNetNuke?
RE: Exception Handling Opinion
hex format
RE: IIS stopped working :(
<for > Build Failed:problem
RE: Separation of Objects from Logic
RE: Tracking pages with long request execution time
sending email to multiple destination
Web Site
ant UI
Easy cut & paste from Excel to R?
Win32 Apache Restart
Improving Tasks
HELP! PLEASE!
RE: Adding Controls to a Page
read table
RE: ASPNET account doesn 't exist!
Best way to uninstall Apache2 on red hat
from win to linux how to web page
XMLParseException changes and creation of XMLLocator2
Re Post: rewrite backslash to forward slash
Target or macrodef?
Page display problem XPSP2
Authentication problems
Dynamic Dictionary Data Type?
Newbie unable access my www from outside
off topic question: Latex and R in industries
Conflict between xtable and Hmisc when using Sweave?
Very old problem without any new solution
mod rewrite help
Basic Authentication question
RE: Code Security
calling ant from java program
prevent double signing
Re: Controlling Copy/Paste/Print
Using R to illustrate the Central Limit Theorem
web server slow too much slow
access to user directories
Links
Home
Official R Project Site
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
RE: Adding Controls to a Page

RE: Adding Controls to a Page

2005-02-22       - By Robert Hanson
Reply:     1     2     3     4     5     6     7     8     9     10     >>  





When you add controls dynamically, they need to be added to the page on
each page load.  Controls added dynamically do not automatically get
recreated on postback, so you have to do this yourself.  The best place to
do this is in the Page_Init() method, because this happens before any
postback or viewstate processing, so controls added at this point
participate fully in both viewstate restore and postback form processing.






"Boudreau, Duane" <BoudreauD@(protected)> on 02/22/2005 01:27:42 PM

Please respond to aspnet-controlbuilding@(protected)

To:    aspnet-controlbuilding@(protected)
cc:

Subject:    [aspnet-controlbuilding] RE: Adding Controls to a Page


I added a table place holder and added the controls on the fly and it
works fine, except when I submit the page the controls no longer exist.
Any idea what needs to be done to get the controls to be displayed on
the submit page? Also how are the control values accesses in the post
back?

int x = 0;
while (qryPM.Read()) {
TableRow tr = new TableRow();
CheckBox cb = new CheckBox();
cb.ID = "cbxPM:" + qryPM["f1"].ToString();
cb.Text = qryPM["f2"].ToString();

TextBox tb = new TextBox();
tb.ID = "txtPMQty:" + qryPM["f1"].ToString();
tb.CssClass = "inputControl";
tb.Width =
System.Web.UI.WebControls.Unit.Parse("30px",System.Globalization.Culture
Info.InvariantCulture);

Label lb = new Label();
lb.ID = "lblPM" + x.ToString();
lb.Text = " " + qryPM["f3"].ToString();

TableCell tc1 = new TableCell();
tc1.Controls.Add(cb);
tr.Cells.Add(tc1);

TableCell tc2 = new TableCell();
tc2.Controls.Add(tb);
tr.Cells.Add(tc2);

TableCell tc3 = new TableCell();
tc3.Controls.Add(lb);
tr.Cells.Add(tc3);

tblPM.Rows.Add(tr);
x++;
}




-----Original Message-----
From: Sonu Kapoor [mailto:sonukapoor@(protected)]
Sent: Friday, February 18, 2005 6:15 PM
To: aspnet-controlbuilding@(protected)
Subject: [aspnet-controlbuilding] RE: Adding Controls to a Page

You can also use a PlaceHolder. Something like this:

Label lbl = new Label;
lbl.Text = "test";

placeholder.controls.add(lbl);

--
Sonu Kapoor
WebSite: http://www.Kapoorsolutions.com
Blog: http://www.Kapoorsolutions.com/blog/

On Fri, 18 Feb 2005 18:11:20 -0500, James Shaw <james@(protected)>
wrote:
> Usually you have a container like an <asp:panel> or <asp:literal> on
the
> page, and then add controls to it with .Controls.Add() from codebehind
>
> Best regards,
> James Shaw
> 2005 Microsoft MVP ASP.NET
> www.CoverYourASP.NET
> Blogging on ASP.NET
> www.CoverYourASP.com
> Download it. Run it. Learn it.
> www.DozingDogs.com
> Over 50 million pages served
>
>
> -----Original Message-----
> From: Boudreau, Duane [mailto:BoudreauD@(protected)]
> Sent: Friday, February 18, 2005 4:30 PM
> To: aspnet-controlbuilding@(protected)
> Subject: [aspnet-controlbuilding] Adding Controls to a Page
>
> Using C#, is there a way to dynamically add controls (labels,
textboxes,
> etc) to a page in its code behind page?
>
> If so can someone point me to a tutorial or some sample code?
>
> Thanks,
> Duane
>
> Need SQL Advice? http://sqladvice.com
> Need RegEx Advice? http://regexadvice.com
> Need XML Advice? http://xmladvice.com
>
> Need SQL Advice? http://sqladvice.com
> Need RegEx Advice? http://regexadvice.com
> Need XML Advice? http://xmladvice.com
>


Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com


Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com







Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com

©2008 junlu.com - Jax Systems, LLC, U.S.A.