J
Julia B
All
This relates to .Net 2.0 using Visual Studio 2005.
I've got a gridview in a content page bound to an objectdatasource. The
datasource's SelectMethod calls on a function in a sub.
I do not call the gridview databind method on page load. However I do call
it after the user has filled out some fields (not in the gridview) and
pressed a submit button (which saves some data to tables which the gridview
will display the results of). This all works fine, then after the code on the
submit button is completed, I get an error because the gridview databind
method runs again without me calling it. Why? Can anyone tell me why the
databind method runs a second time when I'm not calling it? How do I stop it?
The datagrid/datasource code is as follows:
<asp:GridView ID="UploadResultsGrid" runat="server" AllowPaging="True"
AllowSorting="True" BorderColor="#D9D5D2" BorderStyle="Solid"
BorderWidth="1pt"
DataSourceID="UploadResultsDataSource" Font-Names="Tahoma"
TabIndex="8">
<RowStyle VerticalAlign="Top" />
<HeaderStyle BackColor="#D9D5D2" ForeColor="#D7451A"
HorizontalAlign="Left" VerticalAlign="Top" />
</asp:GridView>
<asp:ObjectDataSource ID="UploadResultsDataSource" runat="server"
SelectMethod="FillDataGridParam"
TypeName="RC_Web_FirestormAUCalibration.CommonUtilities">
<SelectParameters>
<asparameter DefaultValue="GetCalibrationRecords"
Name="spName" />
<asparameter DefaultValue="@serialnumberid" Name="ParamName" />
<asparameter DefaultValue="Integer" Name="ParamType" />
<asparameter DefaultValue="0" Name="Paramlength" />
<asp:ControlParameter ControlID="SerialNumberTB"
DefaultValue="Null" Name="ParamValue"
PropertyName="Text" />
</SelectParameters>
</asp:ObjectDataSource>
Thanks in advance.
Julia
This relates to .Net 2.0 using Visual Studio 2005.
I've got a gridview in a content page bound to an objectdatasource. The
datasource's SelectMethod calls on a function in a sub.
I do not call the gridview databind method on page load. However I do call
it after the user has filled out some fields (not in the gridview) and
pressed a submit button (which saves some data to tables which the gridview
will display the results of). This all works fine, then after the code on the
submit button is completed, I get an error because the gridview databind
method runs again without me calling it. Why? Can anyone tell me why the
databind method runs a second time when I'm not calling it? How do I stop it?
The datagrid/datasource code is as follows:
<asp:GridView ID="UploadResultsGrid" runat="server" AllowPaging="True"
AllowSorting="True" BorderColor="#D9D5D2" BorderStyle="Solid"
BorderWidth="1pt"
DataSourceID="UploadResultsDataSource" Font-Names="Tahoma"
TabIndex="8">
<RowStyle VerticalAlign="Top" />
<HeaderStyle BackColor="#D9D5D2" ForeColor="#D7451A"
HorizontalAlign="Left" VerticalAlign="Top" />
</asp:GridView>
<asp:ObjectDataSource ID="UploadResultsDataSource" runat="server"
SelectMethod="FillDataGridParam"
TypeName="RC_Web_FirestormAUCalibration.CommonUtilities">
<SelectParameters>
<asparameter DefaultValue="GetCalibrationRecords"
Name="spName" />
<asparameter DefaultValue="@serialnumberid" Name="ParamName" />
<asparameter DefaultValue="Integer" Name="ParamType" />
<asparameter DefaultValue="0" Name="Paramlength" />
<asp:ControlParameter ControlID="SerialNumberTB"
DefaultValue="Null" Name="ParamValue"
PropertyName="Text" />
</SelectParameters>
</asp:ObjectDataSource>
Thanks in advance.
Julia