J
john
This Error on page load attempt:
A control with ID 'AttachButton' could not be found for the trigger in
UpdatePanel 'UpdatePanel1'.
Condition: File Upload Control inside of and Ajax UpdatePanel, which is
inside of a FormView Insert Template. File Upload Control needs this Trigger
according documentation inside of UpdatPanel for an Attach Button to do a
Post Back.
I assume the error is because the Button does not Exist until I enter the
Insert Template View, but the Trigger has to be outside the Content
Template.
Question is how to avoid the Trigger error until I can get into the FormView
Template; if that is the problem as I descibed it?
Maybe I Should just name the Item Template ButtonNew with that ID just so it
sees it or have a dummy button with that ID but not Enabled?
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<aspostBackTrigger ControlID="AttachButton" />
</Triggers>
<ContentTemplate>
<asp:FormView ID="FormView2" runat="server" DataKeyNames="KeyID"
DataSourceID="SqlDataSourceAdd" Width="775px">
<EditItemTemplate>
</EditItemTemplate>
<InsertItemTemplate>
<asp:Button ID="AttachButton" runat="server" CausesValidation="False"
OnClick="Button1_Click"
Text="Attach Uploaded File" />
<asp:FileUpload ID="FileUpload1" runat="server" Width="500px" />
</InsertItemTemplate>
<ItemTemplate>
<asp:Button ID="ButtonNew" runat="server" CommandName="New"
Text="New" Width="75px" />
</ItemTemplate>
</asp:FormView>
</ContentTemplate>
</asp:UpdatePanel>
Thanks
John
A control with ID 'AttachButton' could not be found for the trigger in
UpdatePanel 'UpdatePanel1'.
Condition: File Upload Control inside of and Ajax UpdatePanel, which is
inside of a FormView Insert Template. File Upload Control needs this Trigger
according documentation inside of UpdatPanel for an Attach Button to do a
Post Back.
I assume the error is because the Button does not Exist until I enter the
Insert Template View, but the Trigger has to be outside the Content
Template.
Question is how to avoid the Trigger error until I can get into the FormView
Template; if that is the problem as I descibed it?
Maybe I Should just name the Item Template ButtonNew with that ID just so it
sees it or have a dummy button with that ID but not Enabled?
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<aspostBackTrigger ControlID="AttachButton" />
</Triggers>
<ContentTemplate>
<asp:FormView ID="FormView2" runat="server" DataKeyNames="KeyID"
DataSourceID="SqlDataSourceAdd" Width="775px">
<EditItemTemplate>
</EditItemTemplate>
<InsertItemTemplate>
<asp:Button ID="AttachButton" runat="server" CausesValidation="False"
OnClick="Button1_Click"
Text="Attach Uploaded File" />
<asp:FileUpload ID="FileUpload1" runat="server" Width="500px" />
</InsertItemTemplate>
<ItemTemplate>
<asp:Button ID="ButtonNew" runat="server" CommandName="New"
Text="New" Width="75px" />
</ItemTemplate>
</asp:FormView>
</ContentTemplate>
</asp:UpdatePanel>
Thanks
John