Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > VS.Net color coding bugs with inline code

Reply
Thread Tools

VS.Net color coding bugs with inline code

 
 
Jon Maz
Guest
Posts: n/a
 
      10-11-2004
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>


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





 
Reply With Quote
 
 
 
 
Martin Dechev
Guest
Posts: n/a
 
      10-11-2004
Hi,

Color coding is supported for VB only. See:

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

Greetings
Martin
"Jon Maz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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>
>
>
> ------------------------------------------
>
>
>
>
>



 
Reply With Quote
 
 
 
 
Jon Maz
Guest
Posts: n/a
 
      10-11-2004
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?


 
Reply With Quote
 
Mikhail Arkhipov (Microsoft)
Guest
Posts: n/a
 
      10-11-2004
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$
http://www.velocityreviews.com/forums/(E-Mail Removed), "Jon Maz" <(E-Mail Removed)> 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?
>
>



 
Reply With Quote
 
Jon Maz
Guest
Posts: n/a
 
      10-12-2004
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


 
Reply With Quote
 
Mikhail Arkhipov (Microsoft)
Guest
Posts: n/a
 
      10-12-2004
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 #(E-Mail Removed), "Jon Maz"
<(E-Mail Removed)> 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
>
>



 
Reply With Quote
 
Jon Maz
Guest
Posts: n/a
 
      10-12-2004
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


 
Reply With Quote
 
Mikhail Arkhipov (Microsoft)
Guest
Posts: n/a
 
      10-13-2004
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 #(E-Mail Removed), "Jon
Maz" <(E-Mail Removed)> 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
>
>



 
Reply With Quote
 
Jon Maz
Guest
Posts: n/a
 
      10-13-2004
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




 
Reply With Quote
 
Mikhail Arkhipov (Microsoft)
Guest
Posts: n/a
 
      10-13-2004
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 (E-Mail Removed), "Jon
Maz" <(E-Mail Removed)> 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
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing font color from current font color to black color Kamaljeet Saini Ruby 0 02-13-2009 04:58 PM
general coding issues - coding style... calmar Python 11 02-21-2006 10:36 AM
Bugs and Bugs...get rid of them Jason Computer Security 1 01-31-2006 10:47 PM
code behind or inline-coding Newbie \(C#,Asp.net\) ASP .Net 2 11-10-2004 07:19 PM
Still use 'ruby-bugs' for Ruby bugs? Josef 'Jupp' Schugt Ruby 2 11-04-2004 10:10 PM



Advertisments