1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
<head runat="server">
<title></title>
<script type="text/javascript" language="javascript">
function getLocationHash() {
hiddenId = window.location.hash;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:HiddenField ID="my_hf" runat="server" />
</div>
</form>
</body>
string script = string.Format(@"var hiddenId = '{0}';" , this.my_hf.ClientID);
if (!Page.ClientScript.IsClientScriptBlockRegistered("clientControlIds"))
{
ScriptManager.RegisterClientScriptBlock(
this,
typeof(Page),
"clientControlIds",
script,
true);
}
Page.RegisterStartupScript("myScript", "<script type=text/javascript language=javascript>getLocationHash();</script>");
string hash = my_hf.Value; |
Partager