Jquery Mobile and Asp.net button events not firing and redirect to back page
In the Jquery Mobile when we try to click on the asp.net button then it would not fire any events and redirect to back page. But when i refresh the page then button click event works like charm. To fix this I have googled but unalbe to find any solution.
The best solution is to fix this problem please add data-ajax=”false” in all the link button you have in your project. Like I was going Page1 to Page2 and on the page2 button click event was not working first time, On page refresh it works. So what I did I added data-ajax=”false” in Page1 link button like below :-
Page 1 Link Button Code
<a data-ajax="false" href="OrderDetails.aspx?OrderId=<%#Eval("DIODR#") %>"> <%#Eval("DIODR#")%/></a>
Page 2 Button code
<asp:Button runat="server" data-ajax="false" ID="btnGetSignature" Text="Get Signature" OnClick="btnGetSignature_Click" />
Server Side Code of button event click
protected void btnGetSignature_Click(object sender, EventArgs e) { Response.Redirect("~/GetSignature.aspx"); }
Hope that would help and save your time too. Feel free to contact me if need any help.
Cheers..
Solved my problem …..
Thanks a lot…
Thnx dear solved my problem 🙂
my pleasure it helped you.
im using jquery 1.11.1 and i add it like this to my asp button
button it wont triger as my code is in behind
could you please send me your code..so i can check what’s wrong with that.
I am facing the same issue how can i send you my code
You can put it in google drive and share with me. Here my email id mukeshsalaria01@gmail.com. you have to send both databaase and code.
Thanks bro! your tip helped me timely!
nice to hear…cheers!
hi admin.
this Technic not working for my jquery site. which is 1.2.1 jquery mobile.
i have added same like your example, still its not working..
could you please help me. thanks.
Hi Naveen,
May be you missed something. If you can send me code then I can check and let you know what’s the exact reason.
You r rocking…Completely wasted almost 2 days….And now it has been resolved…Thanks a lot