不保存HiddenField中的值 [英] not save the value in HiddenField

查看:100
本文介绍了不保存HiddenField中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ScriptManager.RegisterStartupScript(this, this.GetType(), "javascript", "if(confirm('are you sure?')==true){document.getElementById('" + hfMessageBoxValue.ClientID.ToString() + "').vale='YES'}else{document.getElementById('" + hfMessageBoxValue.ClientID.ToString() + "').vale='NO'}{document.getElementById('" + btnSavechecked.ClientID + "').click()}", true);

if (hfMessageBoxValue.Value == "YES")
 {
do something 
 }
else(hfMessageBoxValue.Value == "NO")
 {
do something
 }

推荐答案

你需要把你的JavaScript放到一个文件中然后将其包含在您的aspx页面中。然后使用ScriptManager.RegisterStartupScript调用该函数。
You need to put your JavaScript into a file and then include it in your aspx page. Then call the function using ScriptManager.RegisterStartupScript.


这篇关于不保存HiddenField中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆