I have a jquery popup login in my masterpage having contentPage url
Category.aspx
and in code behind i have written
public void Ligin_Click( object sender,EventArgs e)
{
string Ret = objLogin.LoginValidate(
txtSignInEmail.Text.Trim(),
txtSignInPass.Text.Trim());
if (Ret == "1")
{
Response.Redirect("~/Mobile/Home.aspx?");
}
}
but Response.Redirect
was not working then i have written
Response.Redirect("~/Mobile/Home.aspx?",false);
and it is working fine. but page url is not changing it remains previous page url
Category.aspx
and link button on Home.aspx is not working, throwing exception.
Invalid postback or callback argument.
Event validation is enabled using
<pages enableEventValidation="true"/>
in configuration or
<%@Page EnableEventValidation="true" %> in a page.
For security purposes, this feature verifies that arguments to postback or callback
events originate from the server control that originally rendered them.
If the data is valid and expected, use the
ClientScriptManager.RegisterForEventValidation
method in order to register the postback or callback data for validation.
when i am typing url 'home.aspx' manualy , it is working fine.
jQuery Mobile and asp.net web forms fundamentally don't work together. The postback model and jQuery Mobile's ajax form loading and navigation are incompatible. Move to MVC or turn off ajax.
Make sure to invoke this code before jQuery Mobile initializes. (Include it before the <script>
tag that references jQuery Mobile.)
<script src="jquery.js"></script>
<script>
$(document).bind("mobileinit", function(){
$.mobile.ajaxEnabled = false;
});
</script>
<script src="jquery-mobile.js"></script>
http://jquerymobile.com/demos/1.2.0/docs/api/globalconfig.html
If you are stuck with trying your best to marry jQuery Mobile and ASP.NET WebForms, you can use the data-url
attribute on your data-role="page"
div
to work around your problem of server-side redirection messing with the browser URL.
Use something equivalent to the following, in your .aspx:
<div data-role="page" data-url="<%= Request.Url.PathAndQuery %>">
...
</div>
For more details, read the section titled "Redirects and linking to directories" on this jQuery Mobile doc page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With