Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cant View ASP.NET Controls

Status
Not open for further replies.

daveonion

Programmer
Aug 21, 2002
359
GB
Hi,

I have created an ASP.Net page and inserted a gridview control however when I run the webpage in debug I can see the other controls but not the gridview control. Can anybody help.

Thanks in advance for any information
 
you need to post the relevant code.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Hi Jason, see below.

<form id="form1" runat="server">
<div>

</div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="CT">
<Columns>
<asp:BoundField DataField=field1" HeaderText="MPI" SortExpression="field1" />
<asp:BoundField DataField="TestDateTime" HeaderText="TestDateTime"
SortExpression="TestDateTime" />
<asp:BoundField DataField="TestPerformedID" HeaderText="TestPerformedID"
SortExpression="TestPerformedID" />
<asp:BoundField DataField="DateTimeEntered" HeaderText="DateTimeEntered"
SortExpression="DateTimeEntered" />
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False"
ReadOnly="True" SortExpression="ID" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="CT" runat="server"
ConnectionString="<%$ ConnectionStrings:CTWConnectionString %>"
SelectCommand="SELECT * FROM [table1] ORDER BY [DateTimeEntered]">
</asp:SqlDataSource>
</form>

I havent yet done anything to the gridview, apart from placed it on the page and selected a datasource, thanks
 
don't use SqlDataSource or any other data source controls. when you run into errors or issues, you cannot troubleshoot them.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Hi,

I have changed the autogenerate columns property to true but still no joy, I cant actually see anything on the page, it is just blank.

Is there a setting i need in my browser or somewhere else to enable the usage of asp.net controls, thanks
 
Then you are proably not getting data back from your query. Like Jason says, the datasource controls are not debugable.
 
Hi erm, what i can say i had no records in the table :).

I've now populated the table and can see it.

Sorry for the time wasting

thanks
 
I'm not 100% sure that your connection string will be pulling through correctly - try hard coding it and see if that works as a starter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top