Click here to Skip to main content
12,294,750 members (66,755 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET SQL-Server
hello,
      i want to how to sue triggers in programing and where it will be use in real time programming can u guide or send any snippets
Posted 12-Feb-12 15:09pm
kingsa1.7K
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Hi,

AsyncPostBackTrigger is used to trigger the controls which are outside the updatepanel control on an asynchronus post back.

for more info see following links...

AsyncPostBackTrigger Class

AsyncPostBackTrigger vs PostBackTrigger


Also see below example code:

<head  runat="server">
    <title></title>
    <script type="text/javascript">
        function ShowModal() {
            //Call the Customized user's contro progress bar modal popup... 
            var modalPopupBehavior = $find('loader');
            modalPopupBehavior.show();
            return true;
        }
       
    </script>
</head>
<body>
    <form id="form1"  runat="server">
    <div>
        <table cellpadding="4" cellspacing="0" border="0" width="40%" style="margin-removed 5px;">
            <tr>
                <td width="5%">
                     
                </td>
                <td align="center" colspan="3">
                    <table>
                        <tr>
                            <td>
                                <asp:UpdatePanel ID="upBtnSearch" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
                                    <ContentTemplate>
                                        <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click"
                                            OnClientClick="ShowModal();" />
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                            <td>
                                <asp:Button ID="btnClear" runat="server" Text="Clear" OnClientClick="ShowModal();"
                                    OnClick="btnClear_Click" />
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="5%">
                     
                </td>
            </tr>
            <tr>
                <td width="2%">
                     
                </td>
                <td align="center">
                    <asp:UpdatePanel ID="upGridClaims" runat="server">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                        </Triggers>
                        <ContentTemplate>
                            <asp:GridView AutoGenerateColumns="false" ID="grdClaims" runat="server" OnSorting="grdClaims_Sorting"
                                AllowSorting="true" DataKeyNames="ClaimRecID" OnPageIndexChanging="grdClaims_PageIndexChanging"
                                OnRowDataBound="grdClaims_RowDataBound">
                                <Columns>
                                    <asp:BoundField HeaderText="Claims ID" DataField="ClaimNo" SortExpression="ClaimNo" />
                                    <asp:BoundField HeaderText="Status" DataField="ClaimStatus" SortExpression="ClaimStatus" />
                                    <asp:TemplateField HeaderText="Auth. Code" SortExpression="ClaimStatus">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lnkAuth" runat="server" Text='<%# Eval("LinkText")%>' OnClick="lnkAuth_Click"></asp:LinkButton>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Left" />
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
                <td width="2%">
                     
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
  Permalink  
v3

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 12 Feb 2012
Copyright © CodeProject, 1999-2016
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