如果任何条件成立,我一直在尝试运行代码。它是一个对话框,在Jquery Impromptu上创建回发后弹出。我试图在不同的项目上运行相同的代码,并且它的工作正常但它没有显示条件满足的任何内容
ASPX代码
<!-- JavaScript -->
<script type="text/javascript" src="Scripts/jquery.js"></script>
<script type="text/javascript" src="Scripts/jquery-latest.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="Scripts/wufoo.js"></script>
<script type="text/javascript" src="Scripts/jquery-impromptu.2.6.min.js"></script>
<script type="text/javascript">
function confirmSubmit() {
$.prompt('Are you sure you want to submit?'
, {
buttons: { Ok: true, Cancel: false }
, callback: confirmSubmitResult
}
);
return false;
}
function confirmSubmitResult(v, m, f) {
if (v) //post back if the user clicked OK
$('#<%# btnSubmit.ClientID %>').click();
}
</script>
.CS CODE
protected void Page_Load(object sender, EventArgs e)
{
Page.Header.DataBind();
TextBox2.Attributes.Add("readonly", "readonly");
this.UnobtrusiveValidationMode = System.Web.UI.UnobtrusiveValidationMode.None;
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
string prompt = "<script>$(document).ready(function(){{$.prompt('{0}!');}});</script>";
string message = string.Format(prompt, "This message is coming after postback");
if (TextBox2.Text.Length == 0 || TextBox1.Text.Length == 0)
{
ClientScript.RegisterStartupScript(typeof(Page), "message", message);
}
一点帮助将受到高度赞赏