Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / September 2005

Tip: Looking for answers? Try searching our database.

HTML Auto Tagging

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Buz - 20 Sep 2005 03:47 GMT
In an attemp to avoid frames, but still get the formating I want, I am trying
to use a header control that opens a table, row, and td that I close in a
footer control. But VS keeps closing the tags in the header control. I've
turned of HTML validation and auto pop up of tags, but it still does it, no
matter what I do. How can I keep VS from closing my tags?

Thanks for any help!
Signature

Buz Waitz

Kevin Spencer - 20 Sep 2005 14:03 GMT
Hi Buz,

It would be better, first of all, to post this question to the
microsoft.public.dotnet.framework.aspnet newsgroup, as that is a newsgroup
for questions about writing ASP.Net applications, while this one is a
newsgroup for asking questions about Visual Studio. I can certainly
understand why you posted this here, thinking that you could configure
Visual Studio to not close your tags for you. However, as I will illustrate,
you're barking up the wrong tree there. And you would get more answers from
the other newsgroup.

Still, I can answer your question, and I will.

ASP.Net is designed with a certain object model, which, in order to be as
successful and productive with it as possible, should be (and certainly CAN
be) followed. You have a requirement, which is a fairly common one. In fact,
ASP.Net 2.0 introduces Master Pages to make this sort of thing simpler. But
it certainly CAN be done in ASP.Net 1.1 without having to break the object
model.

The object model is object-oriented, and ASP.Net Controls correspond to HTML
client-side objects. Therefore, it is bad form (and practice) to attempt to
solve this issue by breaking an HTML object in half. Instead, the ASP.Net
object model is similar to the HTML object model in that, as HTML objects
(tags) can enclose and host other HTML objects, so ASP.Net Controls can host
(and enclose) other ASP.Net Controls as well.

So, what you're describing is a "container" for other Controls (and HTML
objects) that will comprise the top, and possibly the bottom and one or more
sides, of all (or most) of your pages. The simplest solution for you would
be to create a User Control, which is a templated control, to host your
other controls and HTML in. Like System.Web.UI.Page, a User Control has an
HTML/Server-side Template, containing both HTML tags, and Server Control
tags. It also has a CodeBehind class that has all of the server-side
functionality, properties, and fields for that Control.

You can easily put other HTML and ASP.Net Controls inside a UserControl,
including other UserControls. If you want design-time support, you can
create a custom Designer class that will enable you to see how the Control
will look when rendered at design time, and even support dragging and
dropping other Controls into it, as well as HTML. This might be a bit too
much trouble for you, though, and it can be avoided by hosting other
UserControls inside the first, and adding them programmatically at run-time.
that way you can simply work with the User Control that makes up the Page
content for that particular Page in the Designer.

Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
I'd rather be a hammer than a nail.

> In an attemp to avoid frames, but still get the formating I want, I am
> trying
[quoted text clipped - 5 lines]
>
> Thanks for any help!
Buz - 21 Sep 2005 02:43 GMT
Hi Kevin,

Thank you for the thoughtful and detailed answer. It certainly makes clear
the way I should go.

I was interested in doing what I attempted because I thought I had seen it
done, and today I looked back and found the example. It does what I was
trying to do, but has quite a bit of javascript mixed in.

It seems the path of least resistance might be to encapsulate my header and
footers in controls and place them into a template that standardizes the
format I want.

Thank you again for the help.

Signature

Buz Waitz

> Hi Buz,
>
[quoted text clipped - 51 lines]
> >
> > Thanks for any help!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.