CassidyHunt
IS-IT--Management
I have an update panel that contains several controls including a gridview. The button trigger works great for populating the gridview. However when I use the select button on the gridview I get a javascript error.
Does anyone know why and how to fix it?
There error is Javascript object expected in the:
__doPostBack('GridView1','Select$0')
Here is my ASP.Net Code
Thanks
Cassidy
Does anyone know why and how to fix it?
There error is Javascript object expected in the:
__doPostBack('GridView1','Select$0')
Here is my ASP.Net Code
Code:
<atlas:UpdatePanel ID="up1" runat="server" RenderMode="inline" EnableViewState="True">
<ContentTemplate>
<div id="report_form">
<asp:TextBox ID="criteria" runat="server" />
<asp:Button ID="btnUpdate" runat="server" Text="Get Data" OnClick="btnUpdate_Click" />
<br />
</div>
<div id="report_data">
<asp:SqlDataSource ID="cust_order_line" runat="server" ConnectionString="<%$ ConnectionStrings:VMFGConnectionString %>"
ProviderName="<%$ ConnectionStrings:VMFGConnectionString.ProviderName %>" SelectCommand="select * from br_cust_order_line where upper(cust_order_id) = upper(:id)">
<SelectParameters>
<asp:ControlParameter ControlID="criteria" Name="id" PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
DataSourceID="cust_order_line" Width="100%" ShowFooter="True" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" GridLines="Horizontal" >
<Columns>
<asp:CommandField ShowSelectButton="True" CausesValidation="False" />
<asp:BoundField DataField="LINE_NO" HeaderText="Line No" SortExpression="LINE_NO" >
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="PART_ID" HeaderText="Reference" SortExpression="PART_ID" >
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="ORDER_QTY" HeaderText="Quantity" SortExpression="ORDER_QTY" >
<ItemStyle HorizontalAlign="Right" />
<HeaderStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField HtmlEncode="False" DataField="UNIT_PRICE" HeaderText="Unit Price" SortExpression="UNIT_PRICE" DataFormatString="{0:C2}" >
<ItemStyle HorizontalAlign="Right" />
<HeaderStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="TRADE_DISC_PERCENT" HeaderText="Discount" SortExpression="TRADE_DISC_PERCENT" DataFormatString="{0:P2}" HtmlEncode="False" >
<ItemStyle HorizontalAlign="Right" />
<HeaderStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="TOTAL_PRICE" HeaderText="Price" SortExpression="TOTAL_PRICE" DataFormatString="{0:C2}" HtmlEncode="False" >
<ItemStyle HorizontalAlign="Right" />
<HeaderStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="ACTUAL_COST" HeaderText="Cost" SortExpression="ACTUAL_COST" DataFormatString="{0:C2}" HtmlEncode="False" >
<ItemStyle HorizontalAlign="Right" />
<HeaderStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="GROSSPROFIT" DataFormatString="{0:P2}" HeaderText="Gross Profit" SortExpression="GROSSPROFIT" HtmlEncode="False" >
<ItemStyle HorizontalAlign="Right" />
<HeaderStyle HorizontalAlign="Right" />
</asp:BoundField>
</Columns>
<EmptyDataTemplate>
Please supply a current sales order.
</EmptyDataTemplate>
</asp:GridView>
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
</div>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="btnUpdate" EventName="Click" />
<atlas:ControlEventTrigger ControlID="GridView1" EventName="SelectedIndexChanged" />
</Triggers>
</atlas:UpdatePanel>
Thanks
Cassidy