I have this code:
<div id="container" style="width: 800px; height:300px; margin: 0 auto;overflow:hidden;"></div>
I need to replace 800px and 300px from database value;
I tried both of the below. But still i am not getting the answer.
Method 1:
<div id="container" style="width:'<% Response.Write(width);%>'px; height:'<% Response.Write(height);%>'px; margin: 0 auto;overflow:hidden;"></div>
Method 2:
<div id="container" style="width:'<%# Eval("width");%>'px; height: <%# Eval("height");%>'px; margin: 0 auto;overflow:hidden;"></div>
The value of height and width variables are defined in page_load() function
int height = 300;
int width = 800;
This is not affecting the resulting web page.
Can anyone help me on this.
HI all,
Thanks for all the support I got answer for my own query!
This was written in designer file where i wanted the display and width and height are defined in code behind file on top of page_load() function
I am not sure if it’s a standard way of writing it. But it’s giving me the desired answer.