S
SAL
Hello,
I'm working, basically my first, AJAX page and am having a few problems.
One is that the Click event for a button I have in UpdatePanel1 is not
getting called. I've tried with the button both inside and outside of the
updatepanel and the event doesn't get called either way. What might I be
missing here?
Incidently, something else, kind of weird, is happening when the button is
clicked, a required field validator control in a detailsview that I have on
the page displays it's text, which in this case is just an astrix.
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:GridView ID="gvStormDetail"
runat="server"
AutoGenerateColumns="False"
DataSourceID="dsStormDetail"
EnableViewState="False"
SkinID="gridviewSkin"
Width="672px"
DataKeyNames="StormValueID">
<Columns>
<asp:CommandField ShowDeleteButton="True" />
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="hlMap" runat="server"
Target="_map">Map</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="StormValueID"
HeaderText="StormValueID" InsertVisible="False"
ReadOnly="True" SortExpression="StormValueID"
Visible="False" />
<asp:BoundField DataField="StormAssetType"
HeaderText="Asset Category" SortExpression="StormAssetType" >
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="StormAssetTypeID"
HeaderText="StormAssetTypeID" SortExpression="StormAssetTypeID"
Visible="False" />
<asp:BoundField DataField="StormAssetName"
HeaderText="Storm Asset Name" SortExpression="StormAssetName" >
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="StmFacilityClkID"
HeaderText="StmFacilityClkID" SortExpression="StmFacilityClkID" >
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField HeaderText="Description"
SortExpression="Description">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server"
Text='<%# Bind("Description") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblDescription" runat="server"
EnableViewState="False" Height="24px"
Text='<%# Bind("Description") %>'
Width="232px"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Estimated Value"
SortExpression="EstValue">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Text='<%# Bind("EstValue") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblEstValue" runat="server"
Text='<%# Bind("EstValue", "{0:C0}") %>'></asp:Label>
<asp:TextBox ID="txtEstValue" runat="server"
EnableViewState="False" Text='<%# Bind("EstValue", "{0:C0}") %>'
Visible="False" Width="96px"></asp:TextBox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField DataField="CntyAssetID"
HeaderText="CntyAssetID" SortExpression="CntyAssetID"
Visible="False" />
<asp:TemplateField></asp:TemplateField>
<asp:BoundField DataField="ModUser" HeaderText="ModUser"
SortExpression="ModUser">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="ModDate"
DataFormatString="{0:MM/dd/yyyy}" HeaderText="ModDate"
HtmlEncode="False" SortExpression="ModDate">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
</Columns>
</asp:GridView>
<br />
<asp:ObjectDataSource ID="dsStormDetail" runat="server"
SelectMethod="GetStormAssetsByCntyAssetdId"
TypeName="StormAssetsMainBLL"
EnableViewState="False"
DeleteMethod="Delete">
<SelectParameters>
<asp:SessionParameter Name="id"
SessionField="cntyAssetId" Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asparameter Name="stormValueId" Type="Int32" />
</DeleteParameters>
</asp:ObjectDataSource>
<br />
<asp:Button ID="btnUpdate" runat="server" EnableViewState="False"
Text="Update All" OnClick="btnUpdate_Click"/>
<br />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="dvStormInsert"
EventName="ItemInserting" />
</Triggers>
</asp:UpdatePanel>
I'm working, basically my first, AJAX page and am having a few problems.
One is that the Click event for a button I have in UpdatePanel1 is not
getting called. I've tried with the button both inside and outside of the
updatepanel and the event doesn't get called either way. What might I be
missing here?
Incidently, something else, kind of weird, is happening when the button is
clicked, a required field validator control in a detailsview that I have on
the page displays it's text, which in this case is just an astrix.
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:GridView ID="gvStormDetail"
runat="server"
AutoGenerateColumns="False"
DataSourceID="dsStormDetail"
EnableViewState="False"
SkinID="gridviewSkin"
Width="672px"
DataKeyNames="StormValueID">
<Columns>
<asp:CommandField ShowDeleteButton="True" />
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="hlMap" runat="server"
Target="_map">Map</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="StormValueID"
HeaderText="StormValueID" InsertVisible="False"
ReadOnly="True" SortExpression="StormValueID"
Visible="False" />
<asp:BoundField DataField="StormAssetType"
HeaderText="Asset Category" SortExpression="StormAssetType" >
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="StormAssetTypeID"
HeaderText="StormAssetTypeID" SortExpression="StormAssetTypeID"
Visible="False" />
<asp:BoundField DataField="StormAssetName"
HeaderText="Storm Asset Name" SortExpression="StormAssetName" >
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="StmFacilityClkID"
HeaderText="StmFacilityClkID" SortExpression="StmFacilityClkID" >
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField HeaderText="Description"
SortExpression="Description">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server"
Text='<%# Bind("Description") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblDescription" runat="server"
EnableViewState="False" Height="24px"
Text='<%# Bind("Description") %>'
Width="232px"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Estimated Value"
SortExpression="EstValue">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Text='<%# Bind("EstValue") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblEstValue" runat="server"
Text='<%# Bind("EstValue", "{0:C0}") %>'></asp:Label>
<asp:TextBox ID="txtEstValue" runat="server"
EnableViewState="False" Text='<%# Bind("EstValue", "{0:C0}") %>'
Visible="False" Width="96px"></asp:TextBox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField DataField="CntyAssetID"
HeaderText="CntyAssetID" SortExpression="CntyAssetID"
Visible="False" />
<asp:TemplateField></asp:TemplateField>
<asp:BoundField DataField="ModUser" HeaderText="ModUser"
SortExpression="ModUser">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="ModDate"
DataFormatString="{0:MM/dd/yyyy}" HeaderText="ModDate"
HtmlEncode="False" SortExpression="ModDate">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
</Columns>
</asp:GridView>
<br />
<asp:ObjectDataSource ID="dsStormDetail" runat="server"
SelectMethod="GetStormAssetsByCntyAssetdId"
TypeName="StormAssetsMainBLL"
EnableViewState="False"
DeleteMethod="Delete">
<SelectParameters>
<asp:SessionParameter Name="id"
SessionField="cntyAssetId" Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asparameter Name="stormValueId" Type="Int32" />
</DeleteParameters>
</asp:ObjectDataSource>
<br />
<asp:Button ID="btnUpdate" runat="server" EnableViewState="False"
Text="Update All" OnClick="btnUpdate_Click"/>
<br />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="dvStormInsert"
EventName="ItemInserting" />
</Triggers>
</asp:UpdatePanel>