473,387 Members | 1,549 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,387 software developers and data experts.

VS.Net color coding bugs with inline code

Hi,

I am writing inline code .aspx pages using VS.Net 2002. The color coding
seems to work for VB.NET inline, and not for C# inline (see below).

Does anyone know how to get this working for C#?

TIA,

JON


------------------------------------------

<%@ Page Language="C#" %>

<script runat="server">

private void Page_Load(object sender, System.EventArgs e)
{
//color coding doesn't work - this line is black
}

</script>
------------------------------------------
<%@ Page Language="VB" %>

<script runat="server">

Sub Page_Load(sender as Object, e as EventArgs)
'color coding works - this line is green
End Sub

</script>
------------------------------------------

Nov 18 '05 #1
14 1736
Hi,

Color coding is supported for VB only. See:

http://msdn.microsoft.com/library/en...sualStudio.asp

Greetings
Martin
"Jon Maz" <jo****@surfeuNOSPAM.de> wrote in message
news:ud**************@TK2MSFTNGP10.phx.gbl...
Hi,

I am writing inline code .aspx pages using VS.Net 2002. The color coding
seems to work for VB.NET inline, and not for C# inline (see below).

Does anyone know how to get this working for C#?

TIA,

JON


------------------------------------------

<%@ Page Language="C#" %>

<script runat="server">

private void Page_Load(object sender, System.EventArgs e)
{
//color coding doesn't work - this line is black
}

</script>
------------------------------------------
<%@ Page Language="VB" %>

<script runat="server">

Sub Page_Load(sender as Object, e as EventArgs)
'color coding works - this line is green
End Sub

</script>
------------------------------------------


Nov 18 '05 #2
Whaaaaaaaaaaaaaaat?!?!? I hope that makes sense to *someone* out there,
'cos it don't make much sense to me....

Ah well, thanks for letting me know, Martin.

:-(

JON

PS Don't suppose anyone knows a workaround?
Nov 18 '05 #3
It works (sort of) in VB simply by accident. Technically neither VS 2002 nor
VS 2003 support coloring or intellisense in inline code. What you see is not
VB color, it is vbscript color. Default server script language in *classic*
ASP is vbscript and that's why <script runat="server"> is colorized using
vbscript engine. You can get colorization of C# using jscript engine by
setting page default server script to jscript. Colorization will be odd
though :-)
Thanks
Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights.
On 10/11/04 7:39, in article #FSgD$
5r*******@TK2MSFTNGP14.phx.gbl, "Jon Maz" <jo****@surfeuNOSPAM.de> wrote:
Whaaaaaaaaaaaaaaat?!?!? I hope that makes sense to *someone* out there,
'cos it don't make much sense to me....

Ah well, thanks for letting me know, Martin.

:-(

JON

PS Don't suppose anyone knows a workaround?

Nov 18 '05 #4
Hi Mikhail,

Well, anything is better than nothing.... How *do* you change the default
server script to jscript? I'm looking around and can't find the setting....

Thanks,

JON
Nov 18 '05 #5
There are two ways, none of them perfect

1. Temporary remove runat=server from the script block

OR

2. Temporary add language="javascript" to the script tag

Don't forget to remove the change when you run the page. Bit of a hassle, I
agree. Fortunately, upcoming VS 2005 provides full language support in
server script blocks.

Thanks
Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights.

On 10/12/04 2:18, in article #F*************@TK2MSFTNGP09.phx.gbl, "Jon Maz"
<jo****@surfeuNOSPAM.de> wrote:
Hi Mikhail,

Well, anything is better than nothing.... How *do* you change the default
server script to jscript? I'm looking around and can't find the setting....

Thanks,

JON

Nov 18 '05 #6
Hi Mikhail,

Mmm, you're right, that is a bit of a hassle...

Do you know if the setting that makes VBScript the default server script
language is hard-coded in a file somewhere in C:\Program Files\Microsoft
Visual Studio .NET, and could therefore be changed?

Cheers,

JON
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.775 / Virus Database: 522 - Release Date: 08/10/2004
Nov 18 '05 #7
It is hardcoded :-(

Thanks
Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights.

On 10/12/04 14:13, in article #x**************@TK2MSFTNGP12.phx.gbl, "Jon
Maz" <jo****@surfeuNOSPAM.de> wrote:
Hi Mikhail,

Mmm, you're right, that is a bit of a hassle...

Do you know if the setting that makes VBScript the default server script
language is hard-coded in a file somewhere in C:\Program Files\Microsoft
Visual Studio .NET, and could therefore be changed?

Cheers,

JON
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.775 / Virus Database: 522 - Release Date: 08/10/2004

Nov 18 '05 #8
Hi Mikhail,

One trick I use with VS.Net is to set the Page Layout in design mode to
FlowLayout instead of GridLayout, using the following hack:

C:\Program Files\Microsoft Visual Studio .NET 2003\
VC#\VC#Wizards\CSharpAddWebFormWiz\Templates\1033\ WebForm1.aspx

Change the body tag from:
<body MS_POSITIONING="[!output DEFAULT_HTML_LAYOUT]">
to:
<body MS_POSITIONING="FlowLayout">

Just to check - you're saying there is *no* equivalent hack for changing the
default server script language to jscript?

Thanks for all the help,

JON


Nov 18 '05 #9
You don't have to use hacks to set page layout to flow, just right click on
project node in Solution Explorer, choose Properties | Web settings and set
default page layout to flow :-)

However, vbscript default for ASP is hardcoded in C++ logic since this
default never changes and it was not necessary to add extra flexibility.
Colorizer simply assumes that if page is server-type and language attribute
is missing or unrecognized, the language is vbscript.

On 10/13/04 2:09, in article ug**************@TK2MSFTNGP14.phx.gbl, "Jon
Maz" <jo****@surfeuNOSPAM.de> wrote:
Hi Mikhail,

One trick I use with VS.Net is to set the Page Layout in design mode to
FlowLayout instead of GridLayout, using the following hack:

C:\Program Files\Microsoft Visual Studio .NET 2003\
VC#\VC#Wizards\CSharpAddWebFormWiz\Templates\1033\ WebForm1.aspx

Change the body tag from:
<body MS_POSITIONING="[!output DEFAULT_HTML_LAYOUT]">
to:
<body MS_POSITIONING="FlowLayout">

Just to check - you're saying there is *no* equivalent hack for changing the
default server script language to jscript?

Thanks for all the help,

JON

Nov 18 '05 #10
> However, vbscript default for ASP is hardcoded in C++ logic

I thought I heard VS.NET was built with C#? Or are you referring to
something else?

Greg

Nov 18 '05 #11
VS, including VS 2005 is COM/OLE based and is 80% C++. Just look at amount
of native code dlls compared to managed assemblies. It is way too expensive
to rewrite in another language. Property grid is managed, parts of Web Form
editor, XML schema and Data designers, a few other things. VS 2005 has a bit
more C#: new XML editor, build subsystem, team server, new Enterprise tools.
However, majority is still C++. Typically new components tend to be managed,
legacy parts remain native.

My team owns HTML editor, btw.

Thanks
Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights.

On 10/13/04 16:57, in article O4*************@TK2MSFTNGP11.phx.gbl, "Greg
Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote:
However, vbscript default for ASP is hardcoded in C++ logic


I thought I heard VS.NET was built with C#? Or are you referring to
something else?

Greg

Nov 18 '05 #12
> My team owns HTML editor, btw.

Then I'll take your word for it. :^)

Greg
Nov 18 '05 #13
I noticed in VS 2005 that ASP 2.0 color-coding was removed.
I still have VS .NET 2003 installed and the syntax is color-coded.

How can I add the syntax color-coding back to the .asp pages in VS .Net 2005?

"Greg Burns" wrote:
My team owns HTML editor, btw.


Then I'll take your word for it. :^)

Greg

Nov 18 '05 #14
You can't, it's simply broken in Beta 1. I fixed it couple of weeks ago, it
should be working properly in Beta 2.

Thanks
Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights.

On 10/18/04 11:01, in article
C0**********************************@microsoft.com, "Brett Mathe" <Brett
Ma***@discussions.microsoft.com> wrote:
I noticed in VS 2005 that ASP 2.0 color-coding was removed.
I still have VS .NET 2003 installed and the syntax is color-coded.

How can I add the syntax color-coding back to the .asp pages in VS .Net 2005?

"Greg Burns" wrote:
My team owns HTML editor, btw.


Then I'll take your word for it. :^)

Greg

Nov 18 '05 #15

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

Similar topics

55
by: Jonas Smithson | last post by:
I've seen a few attractive multi-column sites whose geometry is based on pure CSS-P, but they're what you might call "code afficionado" sites, where the subject matter of the site is "coding...
31
by: Chris Stanley | last post by:
I am using dreamweaver to make an ASP page. I have a table of data from a MSSQL database that is currently showing on the ASP page. I want the ability to change the color based on a priority...
2
by: Reza Alirezaei | last post by:
when we should use Code-Behine and when inline-Coding??? which one is better and why??? thanks for your time
0
by: Elmo Watson | last post by:
OK - I use inline coding - - however I find myself, now, needing to add a reference to AdoDb (don't ask - - boss's directive) I've added a reference in and looked at VS.Net, and, I see, in the...
2
by: Newbie \(C#,Asp.net\) | last post by:
Hi I have two simple questions that I make sure that I have underestood them 1) what is the main difference between inline coding and code behind besides that code behind is part of DLL and is...
86
by: PTY | last post by:
Which is better? lst = while lst: lst.pop() OR while len(lst) 0:
5
by: Bubba | last post by:
I need to use an inline css tag for a few links that will not behave like the a:link and a:hover attributes in my stylesheet. I want to add a special link color with underline and a mouseover...
1
by: sivadotnet | last post by:
Hi, In my Webapplication using c# everything in inline coding that is in .aspx page itself everything coded. we have one Drop down list box(server control). if you selected any option in the drop...
8
by: wangdaixing | last post by:
I am reading "Programming .NET Components" 2nd Edition by Juval Lowy, O'Reilly. In Appendix E, there is a chapter "Coding Practices" which I agree and practice mostly. However, there are a few...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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...
0
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,...
0
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...

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.