473,394 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

help with multiple forms on asp.net 1.1 page, please

hello
i'm building a site that i want to include a user control on the top
of every page (basically a header/nav bar).
in that ascx there are a few vb objects (linkButtons, labels).
in order for them to be accessible to the codebehinds, i need to have
them wrapped in a form with runat=server on the form.

in the main body of the pages, just about every page is going to also
have a form on it, again with the runat=server parm.

then i get the "A page can have only one server-side Form tag"

is there anything i can do?

also in the ascx, i seem to have to make it a full html page because i
need to have a <head> section so that i can include the
<link href="style.css" type="text/css" rel="stylesheet"> line so that
i can access the css.

from what i read, the main page loads first, then the usercontrol page
loads. tried to exclude the <html> wrapper out of the control, but
that just made a mess of things. very stuck on these 2 topics.

help with these 2 topics would be very much appreciated as always!

Feb 5 '06 #1
2 1081
kinda figured out some of my answers, hopefully this will help other
newbies...
turns out, you don't need to wrap vb.net elements in a form
runat=server tag. not sure what i did while coding, but did get an
error that in order for the page to recognize the element it needed to
in a form tag.
for the other question, if you put the css include and javascript
include in the "main" page head section it will be parsed and picked
up by the control. only downside is that in design mode of VS those
attributes won't be picked up, oh well...
thanks

On Sat, 04 Feb 2006 18:58:40 -0500, simon <me@here.com> wrote:
hello
i'm building a site that i want to include a user control on the top
of every page (basically a header/nav bar).
in that ascx there are a few vb objects (linkButtons, labels).
in order for them to be accessible to the codebehinds, i need to have
them wrapped in a form with runat=server on the form.

in the main body of the pages, just about every page is going to also
have a form on it, again with the runat=server parm.

then i get the "A page can have only one server-side Form tag"

is there anything i can do?

also in the ascx, i seem to have to make it a full html page because i
need to have a <head> section so that i can include the
<link href="style.css" type="text/css" rel="stylesheet"> line so that
i can access the css.

from what i read, the main page loads first, then the usercontrol page
loads. tried to exclude the <html> wrapper out of the control, but
that just made a mess of things. very stuck on these 2 topics.

help with these 2 topics would be very much appreciated as always!


Feb 5 '06 #2
CMM
If you go into the ASP code you might notice there is a Form1 element
wrapping the contents. Get rid of it. ASP Usercontrols (in VS2003 at least)
are not much more than an "Include." They're a bit underpowered and stupid.

"simon" <me@here.com> wrote in message
news:ec********************************@4ax.com...
hello
i'm building a site that i want to include a user control on the top
of every page (basically a header/nav bar).
in that ascx there are a few vb objects (linkButtons, labels).
in order for them to be accessible to the codebehinds, i need to have
them wrapped in a form with runat=server on the form.

in the main body of the pages, just about every page is going to also
have a form on it, again with the runat=server parm.

then i get the "A page can have only one server-side Form tag"

is there anything i can do?

also in the ascx, i seem to have to make it a full html page because i
need to have a <head> section so that i can include the
<link href="style.css" type="text/css" rel="stylesheet"> line so that
i can access the css.

from what i read, the main page loads first, then the usercontrol page
loads. tried to exclude the <html> wrapper out of the control, but
that just made a mess of things. very stuck on these 2 topics.

help with these 2 topics would be very much appreciated as always!

Feb 5 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: PaulThomas | last post by:
Working with XP-Pro and VS.Net I have set my Start Page to "Home.aspx" but the application always starts the "Login" page - - - How can I change the start page to the Home.aspx??? On the login...
10
by: Joseph S. | last post by:
Hi, How do I pass a string from one call to a php block to another call in the same page but from another form? Here's my full php code: I'm using two forms in the same page. A hidden field...
1
by: Kelly Olsen | last post by:
Can someone please help me with the following: I have different forms that are all linked together however when I enter data into each, each form shows up as a seperate record. I want them all...
7
by: Stephen | last post by:
I have some code which I call from a custom validator however I seem to have got the logic wrong and im having trouble figuring out how to write my code to get things to work the way I require....
2
by: Daniel | last post by:
I'm new to .Net and all of its abilities so I hope this makes sense. Basically I'm confused on when is the appropriate time to use web forms controls vs. regular HTML. For example in ASP...
5
by: Chris | last post by:
Hi, I have been trying for days, yes days, to use the calender from the asp.net timetracker starter kit. I am now frustrated. I finally get the popup calender to popup but when I click ok to...
7
by: Siv | last post by:
Hi, I have an MDI application that uses a generic "ShowPage" routine in a module that is called when I want to display a child form. The basic idea is that in the module I have declared each form...
8
by: darnnews | last post by:
I have a form. When a person selects a publication from a listbox, this snippet of code is supposed to look up authors that correspond to that publication and populate the Author List Box, but...
3
by: imrantbd | last post by:
I need array type name like "destList" must use for my destlist select box,not a single name.Or need a solution to capture multiple value of "destList" select box and send all selected value in php...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.