Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   VS.Net color coding bugs with inline code (http://www.velocityreviews.com/forums/t88409-vs-net-color-coding-bugs-with-inline-code.html)

Jon Maz 10-11-2004 01:23 PM

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>


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






Martin Dechev 10-11-2004 02:12 PM

Re: VS.Net color coding bugs with inline code
 
Hi,

Color coding is supported for VB only. See:

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

Greetings
Martin
"Jon Maz" <jonmaz@surfeuNOSPAM.de> wrote in message
news:udhy6U5rEHA.3076@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>
>
>
> ------------------------------------------
>
>
>
>
>




Jon Maz 10-11-2004 02:39 PM

Re: VS.Net color coding bugs with inline code
 
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?



Mikhail Arkhipov (Microsoft) 10-11-2004 06:32 PM

Re: VS.Net color coding bugs with inline code
 
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$
5rEHA.392@TK2MSFTNGP14.phx.gbl, "Jon Maz" <jonmaz@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?
>
>




Jon Maz 10-12-2004 09:18 AM

Re: VS.Net color coding bugs with inline code
 
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



Mikhail Arkhipov (Microsoft) 10-12-2004 02:30 PM

Re: VS.Net color coding bugs with inline code
 
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 #FLaYwDsEHA.516@TK2MSFTNGP09.phx.gbl, "Jon Maz"
<jonmaz@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
>
>




Jon Maz 10-12-2004 09:13 PM

Re: VS.Net color coding bugs with inline code
 
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



Mikhail Arkhipov (Microsoft) 10-13-2004 05:55 AM

Re: VS.Net color coding bugs with inline code
 
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 #xNsKBKsEHA.2684@TK2MSFTNGP12.phx.gbl, "Jon
Maz" <jonmaz@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
>
>




Jon Maz 10-13-2004 09:09 AM

Re: VS.Net color coding bugs with inline code
 
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





Mikhail Arkhipov (Microsoft) 10-13-2004 11:45 PM

Re: VS.Net color coding bugs with inline code
 
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 ug8j4PQsEHA.2560@TK2MSFTNGP14.phx.gbl, "Jon
Maz" <jonmaz@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
>
>
>
>





All times are GMT. The time now is 07:44 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.