我有一个需要在 .aspx 中调用的函数,它在如下标记中,我遇到的问题是我需要评估 .cs 类中的属性。我怎么能做到这一点?
<script type="text/javascript">
function Redirect() {
location.href = "homePage.aspx";
}
</script>
<script runat="server">
protected void Button1_Click(Object sender, EventArgs e)
{
if (something is true from the propties set in .cs)
{
Page.ClientScript.RegisterStartupScript(this.GetType(),
"ConfirmBox", "if(confirm('The numbers selected are not in the directory, you wish to continue?') == true){Redirect();};", true);
}
}
</script>