Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 30th, 2004, 03:43 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default Another annoying Microsoft helper

I have my "title" tag set to runat=server in my HTML code. Then I added an HTMLGenericControl to my codebehind to correspond to my "title" so I can set some of it's properties based upon values pulled from a database.

Every so often when I change a web control's property in the designer the runat=server attribute disappears from the "title" tag in the HTML code.

I am sure that this is Microsoft's way of "helping" me out (even though it causes my app to throw an error), but does anyone know specifically why this may be happening?

Thanks.

J
 
Old December 31st, 2004, 05:41 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I think you should ask Microsoft to find out the exact reason, but my guess is that the runat attribute isn't in the "official" scheme that VS.NET uses internally.

So, when the page code is "optimized" / rewritten / changed / whatever, this attribute is simply forgotten and not added to the title tag anymore.

IMO, the Design View of the designer in VS.NET is almost useless. It rewrites code, expands shorthand CSS, changes tags and attributes to uppercase, removes attributes, reformats the code etc etc etc. This makes it impossible to use Design View with any but the most trivial pages.

I am really looking forward to Visual Studio .NET 2005 where you can round-trip between Code and Design View without the loss of work. Finally, after 8 years or so..... ;) (Frontpage, Visual Interdev, the MSIE HTML Editing Control etc etc all suffer from the same problem.)

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old January 4th, 2005, 01:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Thanks Imar. I was ringing in the New Year or I would have responded sooner. That sounds like a pretty good explanation to me about the runat attribute, but it just seems weird that it only does it randomly.

I also agree about the Design view. I guess I really only use it when I want to quickly change a property and don't want to wade through the HTML. I have some pages that get pretty long on the HTML and it is sometimes easier to just click it in Design view and change the property there.

J
 
Old January 4th, 2005, 05:17 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I *think* it doesn't do it randomly. From my experience, it does it only when you add something to the Design Surface, so a rewrite / refresh of the code is necessary. If you switch to Design View and mack again, everything stays in tact.

Wait for VS.NET 2005. It has Design View / Code View round tripping without messing up the code. Also, the runat attribute is now supported on the <head> tags, so you have programmatic access to the head section of your page.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Dangerous by Hed Planet Earth (Track 4 from the album: Blackout ) What's This?
 
Old January 6th, 2005, 11:38 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Quote:
quote:Originally posted by Imar
 ...changes tags and attributes to uppercase...

Tools -> Options -> Text Editor -> HTML/XML -> Format

There you can shut off auto formatting when switching modes and set capitalization to be "As Entered", "Uppercase" or "Lowercase" for both tags and attributes.
 
Old January 6th, 2005, 11:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Thanks. Does this turn off the paragraph indentation as well for the HTML? That is actually a feature that I like.

J
 
Old January 7th, 2005, 03:14 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

These settings are there, but do not always work as expected. In theory they should do what they promise, but you'll find your code messed up anyway when you switch between code and design view...

Imar
 
Old January 7th, 2005, 10:57 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

katsarosj-

Indentation is mainted as expected
 
Old January 7th, 2005, 11:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Thanks to both of you. I will give it a try cross my fingers that I don't have the problems that Imar was referring to.

J
 
Old January 7th, 2005, 04:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Just a follow up. Turning off autoformatting did not work.

J





Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help with Annoying error super007 Classic ASP Databases 6 September 26th, 2007 12:56 AM
Annoying password prompts using ODBC to DB2 d-fxt Access 2 July 1st, 2006 08:18 PM
Extremely annoying VS.Net behavior katsarosj VS.NET 2002/2003 6 April 17th, 2006 09:21 AM
Small (yet annoying) gap gkirk CSS Cascading Style Sheets 2 June 1st, 2005 04:43 PM
'helper' function? jtyson ASP.NET 1.0 and 1.1 Basics 1 June 29th, 2004 08:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.