473,513 Members | 2,616 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Prevent VS from changing my code

Hi

I'm using Studio 2003 and am getting frustrated with it changing my HTML.
For example, I can enter the following:

<asp:label id="myLabel" style="width: 100px" runat="server">

I change to design view then back to HTML view, I find that it's changed the
code:

<asp:label id="myLabel" width="100px" runat="server">

How can I stop it from doing this?

Thanks
Chris

Nov 19 '05 #1
6 981
Chris Mahoney wrote:
Hi

I'm using Studio 2003 and am getting frustrated with it changing my HTML.
For example, I can enter the following:

<asp:label id="myLabel" style="width: 100px" runat="server">

I change to design view then back to HTML view, I find that it's changed the
code:

<asp:label id="myLabel" width="100px" runat="server">

How can I stop it from doing this?

Thanks
Chris


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

Look at the "Apply Automatic Formatting" options.

Damien

Nov 19 '05 #2
I turned them both off and it's still doing it. Any other ideas?

Thanks
Chris
On 19/8/05 7:41 PM, in article
11**********************@g47g2000cwa.googlegroups. com, "Damien"
<Da*******************@hotmail.com> wrote:
Chris Mahoney wrote:
Hi

I'm using Studio 2003 and am getting frustrated with it changing my HTML.
For example, I can enter the following:

<asp:label id="myLabel" style="width: 100px" runat="server">

I change to design view then back to HTML view, I find that it's changed the
code:

<asp:label id="myLabel" width="100px" runat="server">

How can I stop it from doing this?

Thanks
Chris


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

Look at the "Apply Automatic Formatting" options.

Damien


Nov 19 '05 #3
Chris Mahoney wrote:
I turned them both off and it's still doing it. Any other ideas?

Thanks
Chris

Your right. There doesn't seem to be any way to stop it. Why is it
important to you that it's set as a style rather than as the width
attribute? (If I remember correctly, when it's actually rendered it'll
be rendered using a style attribute rather than width anyway)

Damien

Nov 19 '05 #4
The width attribute works correctly in IE, but the server seems to strip it
off if the user's running Firefox. Setting it as a style prevents this, so
it appears correctly in both browsers.

Chris

On 20/8/05 12:18 AM, in article
11**********************@g44g2000cwa.googlegroups. com, "Damien"
<Da*******************@hotmail.com> wrote:
Chris Mahoney wrote:
I turned them both off and it's still doing it. Any other ideas?

Thanks
Chris

Your right. There doesn't seem to be any way to stop it. Why is it
important to you that it's set as a style rather than as the width
attribute? (If I remember correctly, when it's actually rendered it'll
be rendered using a style attribute rather than width anyway)

Damien


Nov 19 '05 #5

Chris Mahoney wrote:
The width attribute works correctly in IE, but the server seems to strip it
off if the user's running Firefox. Setting it as a style prevents this, so
it appears correctly in both browsers.

Chris

Have you updated the browserCaps section of machine.config - I used to
get nasty/bad rendering in Opera, because the default browserCaps
didn't recognise it properly, and I believe Firefox is similarly
affected.

Unfortunately, Microsoft chose a company (cyScape) to do the updating
of this file who then promptly didn't provide any updates. Several
people have gone to the effort of performing updates however. I use the
one from http://slingfive.com/pages/code/browserCaps/

HTH,

Damien

Nov 19 '05 #6
Wow, thanks! I had no idea that there was a 2-minute fix available. This
will save me sooooo much time :)

Thanks again!

Chris

On 22/8/05 9:25 PM, in article
11**********************@f14g2000cwb.googlegroups. com, "Damien"
<Da*******************@hotmail.com> wrote:

Chris Mahoney wrote:
The width attribute works correctly in IE, but the server seems to strip it
off if the user's running Firefox. Setting it as a style prevents this, so
it appears correctly in both browsers.

Chris

Have you updated the browserCaps section of machine.config - I used to
get nasty/bad rendering in Opera, because the default browserCaps
didn't recognise it properly, and I believe Firefox is similarly
affected.

Unfortunately, Microsoft chose a company (cyScape) to do the updating
of this file who then promptly didn't provide any updates. Several
people have gone to the effort of performing updates however. I use the
one from http://slingfive.com/pages/code/browserCaps/

HTH,

Damien


Nov 19 '05 #7

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

Similar topics

4
5493
by: seans | last post by:
Hi, Is there some way from preventing the JavaScript code in a document loaded into an iframe from executing? I don't have access to the pages being loaded into the i-frame so I can't modify then. They are being loaded from a server. thanks again. sean
1
7856
by: Kenny Mullican | last post by:
I am using complex types in order to support serialization/deserialization of floating point numbers, since floating points can't be null. I've seen how to suppress attributes that are "not specified", such as having a float member called Value, and a bool member called ValueSpecified. This instructs the XML Serializer to omit that...
8
4848
by: Smartin | last post by:
I have a form in Access97 which facilitates a query against a production Access database. Users will enter some search terms and see a datasheet view of the results in a subform. The prod table is linked (the form is not included in the production mdb file). I need to ensure that an unexperienced user will not accidentally change the prod...
9
1787
by: Larry Woods | last post by:
I have a method in my base class that I want ALL derived classes to use. But, I find that I can create a "Shadow" method in my derived class that "overrides" the method in my base class. Can't figure out what attribute to put on the base class method to prevent this. TIA, Larry Woods
6
1003
by: John Smith | last post by:
Hello, I'm a junior in using VB.NET. I encountered the following problem: I have a form with some buttons (change password, change username, logout etc.) and below those buttons I have a label that I want to display some text, depending what button was pressed (i.e. Changing Password, etc.). I also want at the same time the click event...
8
8704
by: Fred Zuckerman | last post by:
I'd like to prevent users from accidently going into design view of a form and screwing it up. I've googled the group and have found that the normal method is to use MDE or user level security. I'd like to avoid both of those options as I'm only trying to stop accidental changes, not willful misconduct. These mdb's are too quick/simple to...
5
3218
by: André | last post by:
Hi, I am using this code to prevent multi click asp.net 2.0 c#, System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("SetValue();"); sb.Append("if (typeof(Page_ClientValidate) == 'function') { "); sb.Append("if (Page_ClientValidate() == false) { return false; }} "); sb.Append("this.value = 'Please wait...';");
1
1889
by: RICHARD BROMBERG | last post by:
I am writing an Access program using Access 2000. There may be a small market for the application aI am writing and I would like to do two things. First I'd like to prevent a user from going into the Design View and changing the application or copying the tables. Is there a way to stop the user from going intothe design view. Second...
5
9973
by: Vincent | last post by:
I have a bound listbox control on one of my forms that has an associated afterupdate event. When this event is invoked, I lock the control to prevent the user from clicking on it more than once. However, it appears that Access is queuing the mouse clicks and calling the afterupdate event regardless of whether the control is locked or not. ...
2
3114
by: Dinis Correia | last post by:
Hi all, How do I prevent row change in a Datagridview? Is there something like a BeforeCurrentRowChanged with an eventarg that could prevent from changing current row? I'm using datagridview bind with a datatable. (I think old ADO had an event that could achieve this!) TIA,
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7563
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7125
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7543
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5703
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4757
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3239
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.