473,326 Members | 2,013 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,326 software developers and data experts.

HT make screens morf to fit the current situation?

I am stuck on how to make a screen whose fields are created at runtime so it
can 'morf'' to meet the needs of the current situation.

Using <table id="Table1" runat="server">
</table>
and using code behind to write cells, rows and server controls into the
cells doesn't work ( can't programactially access a table )

I am currently trying to do:

<table id="Table1" runat="server">
<tr><td><asp:PlaceHolder id="PL1"/></td></tr>
<tr><td><asp:PlaceHolder id="PL2"/></td></tr>
</table>

and in code behind

protected System.Web.UI.WebControls.PlaceHolder PL1;
protected System.Web.UI.WebControls.PlaceHolder PL2;

and then wanting to write a server control to each placeholder and then be
able to read and write information to the server controls. But I am unable
to reference the newly created server controls.
Jun 23 '07 #1
3 1140
On Jun 23, 6:56 pm, "xzzy" <mrbikej...@comcast.netwrote:
I am stuck on how to make a screen whose fields are created at runtime so it
can 'morf'' to meet the needs of the current situation.

Using <table id="Table1" runat="server">
</table>
and using code behind to write cells, rows and server controls into the
cells doesn't work ( can't programactially access a table )

I am currently trying to do:

<table id="Table1" runat="server">
<tr><td><asp:PlaceHolder id="PL1"/></td></tr>
<tr><td><asp:PlaceHolder id="PL2"/></td></tr>
</table>

and in code behind

protected System.Web.UI.WebControls.PlaceHolder PL1;
protected System.Web.UI.WebControls.PlaceHolder PL2;

and then wanting to write a server control to each placeholder and then be
able to read and write information to the server controls. But I am unable
to reference the newly created server controls.
Actually, it is not a big problem to create a cell and a control in
it.

Instead of PlaceHolders, try following

// create first row
HtmlTableRow r1 = new HtmlTableRow();
HtmlTableCell c1 = new HtmlTableCell();
r1.Cells.Add(c1);

// create second row
HtmlTableRow r2 = new HtmlTableRow();
HtmlTableCell c2 = new HtmlTableCell();
r2.Cells.Add(c2);

Table1.Rows.Add(r1);
Table1.Rows.Add(r2);

// then you can add a control, e.g.

TextBox txt = new TextBox();
txt.ID = "mytext";
r1.Cells[1].Controls.Add(txt);

Jun 23 '07 #2
the problem is: after the viewer adds/changes information in the textbox,
how to reference the information in the textbox

"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@c77g2000hse.googlegr oups.com...
On Jun 23, 6:56 pm, "xzzy" <mrbikej...@comcast.netwrote:
>I am stuck on how to make a screen whose fields are created at runtime so
it
can 'morf'' to meet the needs of the current situation.

Using <table id="Table1" runat="server">
</table>
and using code behind to write cells, rows and server controls into the
cells doesn't work ( can't programactially access a table )

I am currently trying to do:

<table id="Table1" runat="server">
<tr><td><asp:PlaceHolder id="PL1"/></td></tr>
<tr><td><asp:PlaceHolder id="PL2"/></td></tr>
</table>

and in code behind

protected System.Web.UI.WebControls.PlaceHolder PL1;
protected System.Web.UI.WebControls.PlaceHolder PL2;

and then wanting to write a server control to each placeholder and then
be
able to read and write information to the server controls. But I am
unable
to reference the newly created server controls.

Actually, it is not a big problem to create a cell and a control in
it.

Instead of PlaceHolders, try following

// create first row
HtmlTableRow r1 = new HtmlTableRow();
HtmlTableCell c1 = new HtmlTableCell();
r1.Cells.Add(c1);

// create second row
HtmlTableRow r2 = new HtmlTableRow();
HtmlTableCell c2 = new HtmlTableCell();
r2.Cells.Add(c2);

Table1.Rows.Add(r1);
Table1.Rows.Add(r2);

// then you can add a control, e.g.

TextBox txt = new TextBox();
txt.ID = "mytext";
r1.Cells[1].Controls.Add(txt);

Jun 24 '07 #3
On Jun 24, 4:34 pm, "xzzy" <mrbikej...@comcast.netwrote:
the problem is: after the viewer adds/changes information in the textbox,
how to reference the information in the textbox
you would need an EventHandler

HOW TO: Dynamically Create Controls in ASP.NET by Using Visual C# .NET
http://support.microsoft.com/kb/317794

Jun 24 '07 #4

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

Similar topics

4
by: Obscurr | last post by:
hi, Is there a way of controlling (i.e., using windows.open ) which screen new windows are to appear in, when I have multiple screens ? Is that a programming issue, or does it have to do with...
2
by: Matt C. | last post by:
I've got an application that has several distinct functions. I'd like to make these available as different screens that the user can switch between within a single form, using commands from the...
1
by: Daniel | last post by:
He's my situation, i work in a (big)room that has 3 projectors. I want to develop an application that can control all 3 screens displaying different live data, from a computer that has a video card...
4
by: Troy Fillerup | last post by:
Hello, I am writing a program in c# that will be running on a system with multiple screens. I would like to run my program on one screen and then force all other apps onthe system to come up on...
25
by: Michelle | last post by:
Hi, I am new it vb.net and am looking at writing for touch screens as one of my clients wants their application written for touch screens. I'm sure someone that done this before. Are there links...
7
by: Bill Nguyen | last post by:
This has been posted before but received no response: I need to arrange window screens on the total area of a mulitple-mopnitor desktop. As an example, below is the bound info for my 2-monitor...
0
by: tgips | last post by:
I am creating slide shows using the screens option on Flash 8. I have inserted forward Buttons and Back Buttons to move through the screens. I am using the Behaviors panel to prescribe the actions....
12
by: trbjr | last post by:
Here is my scenario: Screen A ===> Screen B ===> Screen C \\ \\ V Screen C What this means is that sometimes Screen A opens B...
10
by: Hendrik Maryns | last post by:
Hi, Once again I’d like some feedback on the site http://www.weltladen-tuebingen.de. The situation is the following: I, as a real computer freak, have a Big Screen. The lady who is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.