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

Dynamic HTML elements

Hi

how do I add HTML elements dynamically to my page? Is there some similar way
like with ASPX controls, or do I have to render them out in a custom
control?

Thanks, Urs
Nov 18 '05 #1
5 1623
could you be more specific? What is it you are trying to load?
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Urs Vogel" <uv****@msn.com> wrote in message
news:uP**************@TK2MSFTNGP10.phx.gbl...
Hi

how do I add HTML elements dynamically to my page? Is there some similar
way like with ASPX controls, or do I have to render them out in a custom
control?

Thanks, Urs

Nov 18 '05 #2
Look in System.Web.UI.HtmlControls is probably what you are looking for.
They work just like asp.NET controls.
Nov 18 '05 #3
Curt

I build all pages dynamically, and would like, for instance, put some ASP
radio buttons into a group box. I just learned, that I could use FILEDSET as
a container to hold my radio buttons. This works when createing a static
page, but I don't know how to add HTML controls (NOT ASP controls)
dynamically to my page, or how do wrap the code below into HTML opening and
ending tags like <fieldset>...</fieldset>?

RadioButton rbt as new RadioButton();
rbt.Text = uctl.text;
rbt.ID = "ID1";
rbt.Style.Add("style", "Z-INDEX: 100; POSITION: absolute; LEFT: " +
Str(uctl.location.X * zoom) + "px; TOP: " + Str(iTitleHeight + TopOffset +
uctl.location.Y) + "px");
pnl.Controls.Add(rbt);

Any hints? Thanks. Urs.

"Curt_C [MVP]" <software_AT_darkfalz.com> schrieb im Newsbeitrag
news:e$**************@TK2MSFTNGP11.phx.gbl...
could you be more specific? What is it you are trying to load?
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Urs Vogel" <uv****@msn.com> wrote in message
news:uP**************@TK2MSFTNGP10.phx.gbl...
Hi

how do I add HTML elements dynamically to my page? Is there some similar
way like with ASPX controls, or do I have to render them out in a custom
control?

Thanks, Urs


Nov 18 '05 #4
you need a placeholder. If you want to populate the page with somethign from
the code-behind you'll have to put in a placeholder control, or really even
an asp:Label control, and then you can populate it with your html (or
whatever) as you would like from the code-behind....

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Urs Vogel" <uv****@msn.com> wrote in message
news:up**************@TK2MSFTNGP15.phx.gbl...
Curt

I build all pages dynamically, and would like, for instance, put some ASP
radio buttons into a group box. I just learned, that I could use FILEDSET
as a container to hold my radio buttons. This works when createing a
static page, but I don't know how to add HTML controls (NOT ASP controls)
dynamically to my page, or how do wrap the code below into HTML opening
and ending tags like <fieldset>...</fieldset>?

RadioButton rbt as new RadioButton();
rbt.Text = uctl.text;
rbt.ID = "ID1";
rbt.Style.Add("style", "Z-INDEX: 100; POSITION: absolute; LEFT: " +
Str(uctl.location.X * zoom) + "px; TOP: " + Str(iTitleHeight + TopOffset +
uctl.location.Y) + "px");
pnl.Controls.Add(rbt);

Any hints? Thanks. Urs.

"Curt_C [MVP]" <software_AT_darkfalz.com> schrieb im Newsbeitrag
news:e$**************@TK2MSFTNGP11.phx.gbl...
could you be more specific? What is it you are trying to load?
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Urs Vogel" <uv****@msn.com> wrote in message
news:uP**************@TK2MSFTNGP10.phx.gbl...
Hi

how do I add HTML elements dynamically to my page? Is there some similar
way like with ASPX controls, or do I have to render them out in a custom
control?

Thanks, Urs



Nov 18 '05 #5
That's it, thanks.

"Scott Simons" <Scott.Simons.At.MealMagic.Com.Remove.This> schrieb im
Newsbeitrag news:65**********************************@microsof t.com...
Look in System.Web.UI.HtmlControls is probably what you are looking for.
They work just like asp.NET controls.

Nov 18 '05 #6

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

Similar topics

1
by: Sophisticado | last post by:
Apologies for x-posting. I am trying to embed dynamic elements collected from a form in a mime mail. The form sends elements to other pages, a database, and a text mail() message; but, I am...
1
by: SAN CAZIANO | last post by:
I have create a dynamic html table by adding some rows where I have to put some value in an input field and now how can I get all value of all row ??? I try this but it doesn' work button...
4
by: pizzy | last post by:
INTRO: I tried to clean it up for easy reading. I hope I didn't make any mistakes. PROBLEM: WOW, this is some crazy sh!t. I can't get my checkbox (see "TAGSELECTED") to print my textboxes (see...
7
by: Venus | last post by:
Hello, I am trying to generate a dynamic form at runtime and would like to do it using "<asp: ..." form elements as follows Build up the string that is placed somewhere in the HTML code the...
4
by: Venus | last post by:
Hello, Thanks for your reply. I understand that a control can be created dynamically in several ways: 1) using StringBuilder 2) using Controls.Add 3) using ASP PlaceHolder But this is just...
0
by: Venus | last post by:
Hello, After trying some ways to do it I wanted to use something like the code below but for some reason is not working (I have to generate the entire form dynamically (not only the controls)):...
1
by: kusanagihk | last post by:
To all, I'm working on a javascript to dynamic build a common set of HTML controls. 01) I've used the DOM object to build a <div> tag; then build 1 <input type='button'/> and 1 <input...
1
by: truptidalia | last post by:
Hello, I am new to JS and DHTML. I want to add elements like lable, textbox, button etc on differnt events of the page in a div present in html page. So, the contents of present div element...
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
6
by: Harshpandya | last post by:
HI all, I am working on the Ajax and PHP to make dynamic web page application I have HTML page - in which i am calling two different pages Google and NBC from Drop down menu. OUTPUT WANTED:...
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: 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.