J
Jason Wilson
OK I'm obviously fairly new to ASP.NET 2.0. I've used gridviews in the
past but only for pages with static queries that happen onload.
Now I have pretty simple scenario and I think I've followed all the
examples I've been able to find, but I still don't get the gridview to
render:
* I have a form with some textboxes and dropdownlist and a submit
button
* I have sqldatasource that uses form parameters to call a stored
procedure that does my query
* I have a gridview that is bound to the sqldatasource
At runtime, I fill in some know values and submit the form. The page
postsback and then I just see the form and the data entered -- the
gridview never appears.
I've tried adding an event handler for the button onclick that calls
the sqldatasource.select method. Same result.
I know there is something simple that I must be missing.
Any help from the world?
Jason
Here's some abrievated code:
<form id=...>
....some form elements...
....<asp:button...>
<asp:GridView ID="gvSearch" runat="server" DataSourceID="sqlDSSearch"
AutoGenerateColumns="true" AllowPaging="True" AllowSorting="True"
CellPadding="4" ForeColor="#333333" GridLines="None">
....some style stuff...
</asp:GridView>
<asp:SqlDataSource ID="sqlDSSearch" runat="server"
ConnectionString="<%$ ConnectionStrings:csAutomatedBilling
%>"
SelectCommand="PR_Search"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:FormParameter FormField="txtAccession"
Name="Accession" Type="String"
ConvertEmptyStringToNull="true" />
.....some more form parameters...
Type="String" ConvertEmptyStringToNull="true" />
<asp:FormParameter FormField="ddlStatus" Name="Status"
Type="String" ConvertEmptyStringToNull="true" />
</SelectParameters>
</asp:SqlDataSource>
</form>
past but only for pages with static queries that happen onload.
Now I have pretty simple scenario and I think I've followed all the
examples I've been able to find, but I still don't get the gridview to
render:
* I have a form with some textboxes and dropdownlist and a submit
button
* I have sqldatasource that uses form parameters to call a stored
procedure that does my query
* I have a gridview that is bound to the sqldatasource
At runtime, I fill in some know values and submit the form. The page
postsback and then I just see the form and the data entered -- the
gridview never appears.
I've tried adding an event handler for the button onclick that calls
the sqldatasource.select method. Same result.
I know there is something simple that I must be missing.
Any help from the world?
Jason
Here's some abrievated code:
<form id=...>
....some form elements...
....<asp:button...>
<asp:GridView ID="gvSearch" runat="server" DataSourceID="sqlDSSearch"
AutoGenerateColumns="true" AllowPaging="True" AllowSorting="True"
CellPadding="4" ForeColor="#333333" GridLines="None">
....some style stuff...
</asp:GridView>
<asp:SqlDataSource ID="sqlDSSearch" runat="server"
ConnectionString="<%$ ConnectionStrings:csAutomatedBilling
%>"
SelectCommand="PR_Search"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:FormParameter FormField="txtAccession"
Name="Accession" Type="String"
ConvertEmptyStringToNull="true" />
.....some more form parameters...
Type="String" ConvertEmptyStringToNull="true" />
<asp:FormParameter FormField="ddlStatus" Name="Status"
Type="String" ConvertEmptyStringToNull="true" />
</SelectParameters>
</asp:SqlDataSource>
</form>