页面代码:
<body>
<form id="form1" runat="server">
<div id="divFly" style="border:1px solid black;background:red;width:200px;height:200px;display:none;position:absolute;filter:Alpha(opacity=30)">
<table width=100% height=100%>
<tr>
<td>
图层可以显示了。
</td>
</tr>
</table>
</div>
</form>
</body>后台
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Response.Write("<script>document.getElementById('divFly').style.display='block';</script>");
}
}
<body>
<form id="form1" runat="server">
<div id="divFly" style="border:1px solid black;background:red;width:200px;height:200px;display:none;position:absolute;filter:Alpha(opacity=30)">
<table width=100% height=100%>
<tr>
<td>
图层可以显示了。
</td>
</tr>
</table>
</div>
</form>
</body>后台
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Response.Write("<script>document.getElementById('divFly').style.display='block';</script>");
}
}
解决方案 »
- C# 如何把richtextbox里的文字和图片保存到word里
- 帮忙解释一下几个C#语句
- 【在线等求解】dataGridView从数据库读表 判断如果课程等于1 Cells[4] 显示语文 出错…… 提示输入字符不正确
- 又遇到问题了......
- 新手分少,大家帮忙,"索引超出范围"的问题
- 错误页面跳转的问题
- 请问KeyPressEventArgs e能在方法中吗?谢谢
- 那位兄弟有ASP(C#).NET+SQL SERVER 2000的三层结构的OA,给小弟来一份.谢谢了!!!!!!!!!
- 高手帮帮忙,救救小弟吧!
- 老话题:vb.net与vc.net的优势互补,劣势互避的问题。
- 我有一个treeview,里面我直接增加了节点“aa”和"bb",在我的数据库里有aa 和bb 两个字段,我想从数据库里读出aa 和bb 的个数显示在aa和bb的后面,就像aa(1),bb(3)的形势?
- 数据库 远程连接 c# 致命错误
Response.Write输出在页面的最上传下面HTML代码还没加载下来呢,肯定取不到对象
度下下面代码
<body>
<form id="form1" runat="server">
<div id="divFly" style="border:1px solid black;background:red;width:200px;height:200px;display:none;position:absolute;filter:Alpha(opacity=30)">
<table width=100% height=100%>
<tr>
<td>
图层可以显示了。
</td>
</tr>
</table>
</div> <script>document.getElementById('divFly').style.display='block'; </script>
</form>
</body>
页面:
<div id="divFly" style="border:1px solid black;background:red;width:200px;height:200px;display:none;position:absolute;filter:Alpha(opacity=30)">
<table width=100% height=100%>
<tr>
<td>
图层可以显示了1。
</td>
</tr>
</table>
</div> <asp:Button ID="Button1" runat="server" Text="155" OnClick="Button1_Click" />后台:
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("<script>document.getElementById('divFly').style.display='block'</script>");
}这样仍然提示“错误:缺少对象”。
3楼的老大,请问还要怎样注册,才能找到对象啊?
ScriptManager.RegisterStartupScript(this, this.GetType(), "ChangeStyle!", "document.getElementById('divFly').style.display='block' ;", true);
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Button1.Attributes.Add("OnClick","document.getElementById('divFly').style.display='block'");
}
}