473,657 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1630
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******** ******@TK2MSFTN GP10.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.H tmlControls 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.locati on.X * zoom) + "px; TOP: " + Str(iTitleHeigh t + TopOffset +
uctl.location.Y ) + "px");
pnl.Controls.Ad d(rbt);

Any hints? Thanks. Urs.

"Curt_C [MVP]" <software_AT_da rkfalz.com> schrieb im Newsbeitrag
news:e$******** ******@TK2MSFTN GP11.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******** ******@TK2MSFTN GP10.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******** ******@TK2MSFTN GP15.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.locati on.X * zoom) + "px; TOP: " + Str(iTitleHeigh t + TopOffset +
uctl.location.Y ) + "px");
pnl.Controls.Ad d(rbt);

Any hints? Thanks. Urs.

"Curt_C [MVP]" <software_AT_da rkfalz.com> schrieb im Newsbeitrag
news:e$******** ******@TK2MSFTN GP11.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******** ******@TK2MSFTN GP10.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.A t.MealMagic.Com .Remove.This> schrieb im
Newsbeitrag news:65******** *************** ***********@mic rosoft.com...
Look in System.Web.UI.H tmlControls 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
1995
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 unable to send it to a mime e-mail message. I am guessing the problem is in the definition of the dynamic element in the $html section. A test email snippet follows. For the purposes of the test, I set it up to receive the definition of an element...
1
4843
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 onclik=Alert("EditFieldValue2.value"); Please reply me as soon as possible.
4
2135
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 "TAG#") when more than 1 number (see "VLANS") is inputed into my form. QUESTION: How do I make my dynamic form have a dynamic input box(which is created by checking the checkbox and calling the functionC1) inside it and still be able to pass the...
7
3575
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 same way like regular input fields can. strForm = "<form name=""myForm"" runat=""server"">" & vbCrLf strForm += "<asp:button name=""myName"" .... runat=""server"" />" & vbCrLf
4
3303
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 for the controls and not for the form itself. What I am trying to achieve is to create an entire form (including controls)
0
1486
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)): Can anyone make any suggestions on how to do it ? Thanks
1
1537
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 type='text'> object 02) by using appendChild () method, I've successfully append the button and the textbox under the div tag (or container in this case) 03) but now I would like to add the javascript onclick event on the button I've just created...
1
1574
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 changes accordingly. At present, I am adding each element in a form & the dynamic form in the div. I am unable to add the form directly, so i have a label in html div & add the form using insertBefore ('dynamicForm', lbl). <div id="directDIV"...
9
2948
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 got the core of the javascript from here: http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm I noticed in the demo that sometimes the content takes a long
6
2829
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: I want the google page displayed under display message on the same page when i select google. and when i select NBC news - i want the NBC news page to be displayed under the display message on same page.
0
8315
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8829
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8734
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8508
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6172
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1627
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.