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(objec t sender, System.EventArg s e)
{
//color coding doesn't work - this line is black
}
</script>
------------------------------------------
<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Load(sende r as Object, e as EventArgs)
'color coding works - this line is green
End Sub
</script>
------------------------------------------ 14 1755
Hi,
Color coding is supported for VB only. See: http://msdn.microsoft.com/library/en...sualStudio.asp
Greetings
Martin
"Jon Maz" <jo****@surfeuN OSPAM.de> wrote in message
news:ud******** ******@TK2MSFTN GP10.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(objec t sender, System.EventArg s e) { //color coding doesn't work - this line is black }
</script>
------------------------------------------
<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Load(sende r as Object, e as EventArgs) 'color coding works - this line is green End Sub
</script>
------------------------------------------
Whaaaaaaaaaaaaa aat?!?!? 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?
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*******@TK2MS FTNGP14.phx.gbl, "Jon Maz" <jo****@surfeuN OSPAM.de> wrote: Whaaaaaaaaaaaaa aat?!?!? 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?
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
There are two ways, none of them perfect
1. Temporary remove runat=server from the script block
OR
2. Temporary add language="javas cript" 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.p hx.gbl, "Jon Maz"
<jo****@surfeuN OSPAM.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
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
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****@surfeuN OSPAM.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
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\ CSharpAddWebFor mWiz\Templates\ 1033\WebForm1.a spx
Change the body tag from:
<body MS_POSITIONING= "[!output DEFAULT_HTML_LA YOUT]">
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
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****@surfeuN OSPAM.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\ CSharpAddWebFor mWiz\Templates\ 1033\WebForm1.a spx
Change the body tag from: <body MS_POSITIONING= "[!output DEFAULT_HTML_LA YOUT]"> 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 practices." (One
example of this is alistapart.com.) However, the project/development
realities for small boutique sites are completely different from those
of large commercial or institutional sites -- and I was curious to see
what coding approaches...
|
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 number that's
in the MSSQL database (same recordset that the data comes from). I
don't have the priority field out on the page but can put it out if
need be. I have 3 different priority numbers and if the first row is
priority 1 I want the font to...
|
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
|
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 project
file:
<Reference
Name = "adodb"
AssemblyName = "adodb"
|
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 not visible like inline coding .
2) I am strill kind of confused why there is HTML server control when we
have equivalents in Web server controls ,why we should make an HTML control
to be run at server ?? what is the main difference betwwen these...
| |
by: PTY |
last post by:
Which is better?
lst =
while lst:
lst.pop()
OR
while len(lst) 0:
|
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 a:hover attribute to eliminate an
underline when underlined to a series of links . Wondering how possible
putting an inline style such as this to <a hreftag
thanks
|
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 down box the page will get refresh.
after that focus is going some where i need to fix the focus in the same drop down list box.
inline code i need. using c#
Can anyone help me.
|
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 items I don't
quite understand why as listed below, my questions are marked Q:
10. Avoid method-level document.
a. Use extensive external documentation for API documentation.
b. Use method level comments only as tool tips for other developers.
...
|
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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 most users, this new feature is actually very convenient. If you want to control the update process,...
| |
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |