1,105,585 Community Members

Assign value to dynamic div

Member Avatar
vipmo
Newbie Poster
5 posts since Oct 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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???

Member Avatar
JorgeM
IT Addict
6,423 posts since Dec 2011
Reputation Points: 581 [?]
Q&As Helped to Solve: 963 [?]
Skill Endorsements: 172 [?]
Moderator
Featured
Sponsor
 
0
 

Try

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

Member Avatar
vipmo
Newbie Poster
5 posts since Oct 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Question Answered as of 1 Year Ago by JorgeM
Member Avatar
JorgeM
IT Addict
6,423 posts since Dec 2011
Reputation Points: 581 [?]
Q&As Helped to Solve: 963 [?]
Skill Endorsements: 172 [?]
Moderator
Featured
Sponsor
 
0
 

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

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article