3

我有一个 div,我通过后面的代码调用Page.ClientScript.RegisterStartupScript 另一个 div 在这个 div 中,style="display: none;当我在后面的代码中调用主 div 时,是否可以启用第二个 div?

这是我的代码- Page.ClientScript.RegisterStartupScript(this.GetType(), "OpenNewWindow", "<script type='text/javascript'>$(function() { $('#MainDiv').dialog('open'); })</script>");

4

2 回答 2

1
put these attributes in div runat="server"  and an id="a_name"
Declare Your div like following

<div runat="server" id="dv">
your contents
</div>

call the dv from Code behind and then do with that dv whatever you want 
于 2013-07-13T12:12:05.683 回答
0

我这样称呼第二个div的类名-

Page.ClientScript.RegisterStartupScript(this.GetType(), "OpenNewWindow", "<script type='text/javascript'>$(function() { $('#MainDiv').dialog('open'); });$('.second-div-class').show();</script>");
于 2013-07-18T17:54:30.567 回答