Free Jobs
Reference




Dot Net Forums: ASPNET (77) C#.NET (39) VB.NET (8) AJAX (21) Silver Light (1) WCF (10) WPF (1) WWF (1) .NET 3.5 (3) SQL SERVER (38) Other (3)

Topic: What is the use of postback trigger in UpdatePanel if AJAX is made for partial post back

To get the Posted Questions details daily in your mail Click Here

Share this Post on Facebook/Twitter/Orkut Bookmark and Share





User: dhiraj5079 Post Date: 11 Apr 2011 08:40

Introduction:
In this post I will be explaining you with a example What is the use of postback trigger
in UpdatePanel if AJAX is made for partial post back



Main Content:

Ajax is designed for partial page update so if you will try to do Full post back

say use a button inside the update panel that has to do Response.Redirect to another

page it will give error.


So to fix this problem we need to use post back trigger update panel trigger.


Code is given as below:


<ajax:UpdatePanel ID="UpdatePanel2" runat="server">

<Triggers>

<ajax:PostBackTrigger ControlID="ButtonSend"  />

</Triggers>

<ContentTemplate>            




protected void ButtonSend_Click(object sender, EventArgs e)

    {

       //do some work         

      

        Response.Redirect("Letter.aspx");

    }


Conclusion:
This is one case when we can use trigger.



About Writer:
Hi,I am IT Professional From Mumbai


Writer's Link: http://

Writer's Email:







Comments:
Post Comment





Similar Articles Top ArticlesLatest Articles Other Articles by this Author







www.freejobsreference.com Copyright © 2009-2011 | All Rights Reserved
All content of this website is protected by copyright laws and should not be reproduced in any form or by any means without written permission
(Best viewed in IE 8.0+ or Firefox 3.0+ at resolution of 1024 * 768 or higher)