ASP.NET MVC3 jQuery mobile page's Ajax code binding using PageInit event

后端 未结 6 1189
北恋
北恋 2020-12-10 23:00

We are writing JQueryMobile application using ASP.NET MVC3 + JqueryMobile RC1. Few pages have their own Ajax methods which we call using jQuery code ($.getJSON()

6条回答
  •  执笔经年
    2020-12-10 23:43

    It sounds like you might need to wrap your code in an IsPostBack check. For example:

    void Page_Init(object sender, EventArgs e) 
    {
        if (!IsPostBack)
        {
            RegisterScriptHere();
        }
    }
    

    EDIT

    On a second reading, you may not be asking about the server side, if you are trying to do this on the client side, ignore my answer.

提交回复
热议问题