Div tag Calling from Server..

Posted by Naveenmanam under ASP.NET on 4/29/2010 | Views : 3391 | Status : [Member] | Replies : 4
i have a div tag..

<div id="postitcontainer" runat="server">
<% Response.Write(StickyNotes.Support.getOldPostits(txtSearch.Text)); %>

</div>

during page load it will execute a method and return some script.
i am calling that div tag from a method
var cont=document.getElementById("postitcontainer");

but i want to call div tag from server side
how can i do this

NaveenKumar


Responses

Posted by: Pavanandey on: 4/29/2010 [Member] Bronze

Up
0
Down

since u have specfied runat="sever" for the div tag u can directly access the div tag with the id specfied in sever side.

Thanks
Pavan Kumar
Mark Answer if this fits the need

Naveenmanam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naveenmanam on: 4/29/2010 [Member] Starter

Up
0
Down
that means <div id="userManagerForm" runat="server">
</div>



it is server side..?

but above code are not server side my lead says.

NaveenKumar

Naveenmanam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SurajRane on: 4/29/2010 [Member] Starter

Up
0
Down
When you specify runat ="server".

control will be server side. no doubt it will be rendered as div at client side.

you can directly access the control in code behind using its Id. Also you can access it at client side using

document.getElementById("id")

If you still in confusion visit msdn library.



Naveenmanam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naveenmanam on: 4/29/2010 [Member] Starter

Up
0
Down
ok thank you surajrane i visit the MSDN

NaveenKumar

Naveenmanam, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response