document.getElementById("Hidden1")为什么老不对
*.aspx.cs
中调用Page.RegisterStartupScript("del","document.getElementById("Hidden1").Value = confirm('初始化数据')");
老是错误,无法取到hidden1
*.aspx中
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="main.aspx.cs" Inherits="main" Title="无标题页" %>
<%@ MasterType VirtualPath="~/MasterPage.master" %>
<script runat="server">
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.style3
{
width: 220px;
height: 472px;
text-align: left;
background-color: #FFFFFF;
}
.style6
{
width: 99%;
}
.style7
{
height: 23px;
width: 220px;
}
.style9
{
height: 23px;
width: 1000px;
}
.style8
{
width:220px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table class="style6">
<tr>
<td>
<asp:HiddenField ID="HiddenField1" runat="server" />
<br />
<br />
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
<br />
</td>
<td>
</table>
</asp:Content>