I have 2 , one is created in design time and one is created in runtime. Now i want to get the property value of these
, which is set at the time of creation. E.G.
Like for div 1:
for div 2:
HtmlGenericControl div1=new HtmlGenericControl();
div1.ID="hello";
div1.style.add("left","300px");
After creating my
like this, i would like to get the value of left property of both
in runtime using c#.
How can i get it...?
Thanks..
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Vishal GilbilePosted Apr 8, 2013, 7:13 AM
you can only access server control in your code behind. Therefore you will have to set the attribute runat="Server" on both the div and also provide a unique id through which you can access those div's.
And you can access it like the following