0

如果任何条件成立,我一直在尝试运行代码。它是在 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 代码

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);


    }

一点帮助将不胜感激

4

0 回答 0