We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,605 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Assign value to dynamic div

I created a page dynamically check below the example
label l=new label()
l.id="lbltest"
l.text+="<div id=name name=name runat=server><br />"
l.text+="<div id=age name=age runat=server><br />"
l.text+="<div id=gender name=gender runat=server><br />"

my question is as follows I want to assign values to name and age. How can that be done?

I have tried to do it using javascript
Collapse | Copy Code
document.getElementById("name").value="test"
but got an error NULL POINTER how can assign value to div after page load?Any suggestions???

2
Contributors
3
Replies
5 Hours
Discussion Span
7 Months Ago
Last Updated
4
Views
Question
Answered
vipmo
Newbie Poster
5 posts since Oct 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Try

document.getElementById("name").innerHTML="test"

JorgeM
Industrious Poster
4,164 posts since Dec 2011
Reputation Points: 297
Solved Threads: 567
Skill Endorsements: 119

same result!! got null pointer I want any method doesn't have to be using javascript

vipmo
Newbie Poster
5 posts since Oct 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 7 Months Ago by JorgeM

feel free to post what you did to resolve the issue so that others can benefit from your experience.

JorgeM
Industrious Poster
4,164 posts since Dec 2011
Reputation Points: 297
Solved Threads: 567
Skill Endorsements: 119

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0614 seconds using 2.71MB