Question : BeginRequestHandler and EndRequestHandler Can't find control

through a prior question, i learned how to disable a button using an UpdatePanel and respective JavaScript

Now that I'm try to port the code to my real app, I can't get it to find the controls.

the difference is that in the sample i used to learn how to do this, the button to disable was right out there on the page.

now, it's inside a gridview row, which is inside a tabcontrol panel which is inside a content element of a master page!

Quite a stretch.

anyway, I have no idea about how to reference the button within the javescript (all attached

Any help would be most appreciated
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
the lbBuildProjection LinkButton resides within:
	Master Page
	==>	TabContainer
		==>	Gridview
			==>	Command Column
				==>	LinkButton lbBuildProjection

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
      <script language="javascript" type="text/javascript">
        Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function BeginRequestHandler(sender, args) {
          var nm = sender.toString();
          var str1 = new String(sender._postBackSettings.sourceElement.id);
          var idx = sender._postBackSettings.sourceElement.id.indexOf("lbBuildProjection");
          if (idx > -1) {
            var buttonId = sender._postBackSettings.sourceElement.id;
            var button = document.getElementsByName(buttonId);
            button.disabled = true;
          }
        }

        function EndRequestHandler(sender, args) {
          var button = document.getElementById("<%= lbBuildProjection.ClientID %>");
          button.disabled = false;
        }
    </script>


<cc1:TabContainer ID="tcProjections" runat="server" Width="100%"  ActiveTabIndex="0" >
  <cc1:TabPanel runat="server" ID="TabPanel1" HeaderText="Projection Setup">
   <ContentTemplate>
    <asp:GridView ID="gvPPProj" runat="server" AutoGenerateColumns="False" DataKeyNames="QPPProjId" DataSourceID="ldsPPProj" OnRowCommand="gvPPProj_RowCommand" onrowupdating="gvPPProj_RowUpdating" CellPadding="4" ForeColor="#333333" GridLines="Vertical" onrowcreated="gvPPProj_RowCreated" onrowdeleting="gvPPProj_RowDeleting" CssClass="ComicSmall100CenterRb" AllowSorting="True">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:TemplateField ShowHeader="False">
                <EditItemTemplate>
                    <asp:LinkButton ID="lbUpdate" runat="server" CausesValidation="True" CommandName="Update" Text="Update" ToolTip="Save this projection row"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="lbCancel" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" ToolTip="cancel the edit of this row"></asp:LinkButton>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="lbEdit" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" ToolTip="Edit this row"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="lbNew" runat="server" CausesValidation="False" CommandName="New" Text="New" ToolTip="Add a New Projection Row"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="lbSelect" runat="server" CausesValidation="False" CommandName="Select" Text="Select" ToolTip="Choose this row to make Projection"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" ToolTip="Delete this row (Use Caution)" Enabled="False" Visible="False"></asp:LinkButton>
                    <asp:UpdatePanel ID="pnlGrid" runat="server" UpdateMode = "Conditional" >
                      <ContentTemplate>
                        &nbsp;<asp:LinkButton ID="lbBuildProjection" runat="server" CausesValidation="False" CommandName="BuildProjection" 
                                    Text="Build Projections" ToolTip="Project Targeting $" 
                                    ></asp:LinkButton>
                      </ContentTemplate>
                      <Triggers>
                          <asp:AsyncPostBackTrigger ControlID="lbBuildProjection" EventName="Click" />
                      </Triggers>
                    </asp:UpdatePanel>
                </ItemTemplate>

Answer : BeginRequestHandler and EndRequestHandler Can't find control

Here are three files implementing the php image tag.  I just put the image return in the php file, you can add the database code above or below that.
Random Solutions  
 
programming4us programming4us