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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie Question to Display Database Grid

Status
Not open for further replies.

jasonp45

Programmer
Aug 23, 2001
212
US
I am a relatively experienced VB/Database programmer but know nothing about Web programming.

Using ASP.net/Visual Studio 2003 I have created a web page that has an option box and a couple of input boxes, plus a submit button. A second page uses the info from the first page to hit an SQL database and display the results in the grid.

Initially I was trying to do it all on one page, and everything worked, but I decided it would be smoother having the grid on a separate page. When I created the second page and moved the datagrid and data connection over there, I got an error stating "page can have only one server-side Form tag".

From what I've gathered online, this means only one of the pages can have a runat=server tag...which page should it be - the second page with the grid? If so, what is the best way to convert the first page over (i.e., in the IDE should I add an HTML page (versus ASPX) and just copy everything)? Also, how do I get the variable information from the first page over to the second so I can query my database?

I realize these are very basic questions, so if you have any links to a good primer that would be appreciated.
 
I'd suggest that you need to check your code for multiple forms on one page. (Note, I am new to all this so this is a guess from my own experiences !)

IIRC, you can have several forms on a page, but only 1 form is allowed to have the runat="server" property.

I have lots of runat=server tags on each of my pages, but only 1 form on each page that is server side

K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top