Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 30th, 2004, 03:43 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
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
  #2 (permalink)  
Old December 31st, 2004, 05:41 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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.
  #3 (permalink)  
Old January 4th, 2005, 01:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
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
  #4 (permalink)  
Old January 4th, 2005, 05:17 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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?
  #5 (permalink)  
Old January 6th, 2005, 11:38 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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.
  #6 (permalink)  
Old January 6th, 2005, 11:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
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
  #7 (permalink)  
Old January 7th, 2005, 03:14 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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
  #8 (permalink)  
Old January 7th, 2005, 10:57 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

katsarosj-

Indentation is mainted as expected
  #9 (permalink)  
Old January 7th, 2005, 11:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
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
  #10 (permalink)  
Old January 7th, 2005, 04:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

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

J
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:11 AM.


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