Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET VB.NET updatepanel , +
I have one ASP.Net page with Master page and some User Controls there.
 
That page contains one Update Panel and Ajax Tab Panel
on tab change of tab panel i will load My User Control as per tab position.
now what i want some thing like this.
in some user control i put link button for exporting data of Grid View to excel file.
i did this before with my own function but it will work only when the page is not having any update panel and if having update panel then the button which is used to export data will registered as a post back trigger in side update panel.
 
so i want to register my user controls export button to my Page's Update panel's post back trigger.
how to do this.?
Posted 25-Jun-12 1:17am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

i want to register my user controls export button to my Page's Update panel's post back trigger
All you need is to register the button as PostbackTrigger for that update panel.
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
    <ContentTemplate>
       Other controls here... 
       <asp:Button id="UploadButton"
           Text="Upload file"
           OnClick="UploadButton_Click"
           runat="server">
       </asp:Button>
    </ContentTemplate>
    <Triggers>
    <asp:PostBackTrigger ControlID="UploadButton" />
    </Triggers>
</asp:UpdatePanel>
Refer: MSDN: PostBackTrigger Class[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Update Panel has AsyncPostBack triggers, within which you can embed button and point to the respective panel, this solves your problem
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Hi,
 
In order to achieve this you need to do both the things
1. Register the control to the script manager using RegisterPostBacjControl
2. Use Asynchronous PostbBackTrigger in which give the button control ID
 
Thanks:
www.alacraft.com.au
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

For adding Controll id to Update Panel Trigger from Child Control Codebehind page, simply use this.
 
use your script manager associated with that update panel like this.
pass your control like this.
ToolkitScriptManager.GetCurrent(Page).RegisterPostBackControl(lnkBhaItemsExportToExcel)
  Permalink  
Comments
Strange_Pirate at 29-Sep-12 0:56am
   
Better to use AsyncPostBack triggers !!
 
Wat you say Sir.
Nel Mateo at 7-Aug-14 0:58am
   
Thanks Tejas, among the solutions presented for this question, yours is the one that worked for my case.
Tejas Vaishnav at 7-Aug-14 4:27am
   
Its great to hear that, its work for you. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,127
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 28 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100