Post Back Problem with jquery [Resolved]

Posted by Shwetacparikh under jQuery on 6/5/2012 | Points: 10 | Views : 1973 | Status : [Member] | Replies : 4
Hello Friends,

I am new to jquery and trying some basic things.

i am trying to hide a button on button's click event.

now when i click on the button, the button hides for a movement and displays again.

can u please guide me for this.i guess this is a problem due to page post back because when i work with html button it works fine.

my code is
$(document).ready(function () {
$("#Btn1").click(function () {
$("#Button1").hide();
});
});
<asp:Button id ="Btn1" runat ="server" Text ="I am Asp.Net Button" />
<asp:Button id ="Button1" runat ="server" Text ="I am Button" />

Thanks in advance.
Shweta Parikh




Responses

Posted by: Svandanapu on: 6/5/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
Try this

$(document).ready(function () {
$("#Btn1").click(function () {
$("#Button1").hide();
return false;
});
});

Shwetacparikh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shwetacparikh on: 6/6/2012 [Member] Starter | Points: 25

Up
0
Down
Ok its done thanks a lot... i am the beginner in jquery can u suggest me some good site to learn it.right now i m trying with w3schools.com..

Shwetacparikh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shwetacparikh on: 6/11/2012 [Member] Starter | Points: 25

Up
0
Down
Hi ,

the previous issue is resolved but the problem i am facing right now is that the page_load and button_click event firing stopes after the sentence return false;

can u please help me with this?

how can i handle both the things.

Thanks.
Shweta Parikh

Shwetacparikh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 12/18/2012 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

Refer this urls for postbacks


http://www.akhildeshpande.com/2011/08/simple-jquery-getjson-example-in-aspnet.html
http://shashankshetty.wordpress.com/2009/03/04/using-jsonresult-with-jquery-in-aspnet-mvc/
http://www.codeproject.com/Articles/41828/JQuery-AJAX-with-ASP-NET-MVC
http://geekswithblogs.net/michelotti/archive/2008/06/28/mvc-json---jsonresult-and-jquery.aspx


http://www.akhildeshpande.com/2011/08/simple-jquery-getjson-example-in-aspnet.html
http://shashankshetty.wordpress.com/2009/03/04/using-jsonresult-with-jquery-in-aspnet-mvc/

http://geekswithblogs.net/michelotti/archive/2008/06/28/mvc-json---jsonresult-and-jquery.aspx


http://www.akhildeshpande.com/2011/08/simple-jquery-post-example-with-aspnet.html


Mark as Answer if its helpful to you

Shwetacparikh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response