VS2010: Syntax Color Highlighting And Intellisense In A JS File?
Apr 27, 2010
I have an external *.js file that contains Javascript. How do I get teh same intellisense and color highlighting as I do in an ASPX page?
Here's my options for the js extension (set to 'Script Editor')
And here's what it looks like in an ASPX page (How I would like it to look.)
BTW, I did a full reset my Settings, setting them to VB and no luck.
Update to original post:
Cuban suggested I add a reference to the file "jquery-1.3.2.min.js." When I searched my PC for that file using the fastest bestest Search app ever written, it found it it .003 nano seconds in the following locations:
Basically, the file magically appeared in a couple of my throw away VS2010 test web apps and in a VS2008 Common folder. I don't know why it was added or how I got it and why it doesn't appear under the 2010 web app that I am currently working on.
How would I modify the following statement from Cuban? Do I need to set a reference something first? And what's with the triple slash? I haven't seen this convention before.
I think my main problem is actually more to do with master pages that anything else.. Below is a description:
If you use master pages in your website and you have pages in different sub directories then the simplest way to add JQuery references is using <script src='<%# ResolveUrl ("jq.js")%> /> in the master page header??
This means that the .js files are correctly referenced in all pages that use the master. My main problem is that intellisense only seems to work for JQuery when the JQ Script is actually referenced in the header and not by using ResolveUrl('') <script src="/scripts/jq.js" />
I dont want to have to live without intellisense, Surely there is a way to get around this. What am I doing wrong.
I have built a simple custom ASP.NET control that expects it's body content to be javascript. Is there a way to tell Visual Studio that the content should be javascript, and therefore provide syntax highlighting / intellisense goodness?In case it helps, here's the framework of the control I'm working with.
namespace MyNamespace { public class MyControl : Control
In my company we have setup an architecture where all applications share the js scripts to avoid duplicate files and update hundred of files everytime we do an update to the javascripts functions.
The issue that I am having is when I create a reference to those scripts from website A to a function in website B, the intellisense doesn't work. Copy the javascript to website B is not an option. What I am asking if there is a way to make the intellisense work when i am working with projects in this architecture.
I have a poster in the Japanese WebMatrix forum asking if it's possible to change and or disable the color highlighting php syntax, which looks like yellow by default.
(Actually I myself is an IT newbie, show me a step-by-step procedure to solve the above issue!!)
I'm just getting started with C++ and I'm having a little trouble with intellisense. I've created an empty project and added a few variables to the only existing cpp file that I created.When I'm slowly typing out the name of the variable I expected it to show up like in visual basic .NET but it doesn't seem to be.something wrong, or is there a setting somewhere I need to adjust
I have an intellisense problem in VS2008.I use code-behind, and though I can declare ASP elements in the aspx file, it's as if the code can't see them.The pages run OK,but when I type anAspLabel and then '.' for example, intellisense does not pop up the methods and members for this asp label.
I've tried the reset option in Options > Text Editor.Intellisense works fine if the class instance is declared in the code behind file,but it won't recognise web controls declared on the aspx page.
I know I've seen this in one of the video tutorials but I have no idea which one and I have reinstalled VS since then. I think it was Chris Pels that showed how to set up VS so that you had IntelliSense for XML files. The reason I ask is because I'm going through the Security tutorials series and working on the web.config file and the editor doesn't highlight the closing or opening tag when you click on one or the other like it does for HTML or C#.
Not sure if I'm explaining this clearly or not. When working with HTML or C# I can click on the opening tag for an element, say a div tag and VS will bold the type of the closing div tag. This makes it easy to be sure that I'm not messing up my tags. Well this doesn't happen with an XML document. I saw in one of the videos where the author configured the settings in VS so that IntelliSense would work in an XML document. I just don't remember the path to those settings or what changes were made.
I would like to include a word document, and unused program files in a folder as part of my project, but I don't want it compiled, etc. How is the best way to do this?
Actually i am trying to storing the uploaded file into database but when i run this codes:
[Code]....
I got this error: " Incorrect syntax near the keyword 'File'.Incorrect syntax near the keyword 'File'. " can anybody tell me why this error came out?I tried toi change my connection string in web config,but it still showing the same error each time i run it in my local.
I create dynamic pdf file using rdlc with the help of Dataset file (xsd). It is working fine in VS2005. The sampe project not working VS2010. Here dataset class not find in code behide.
I'm having problem in inserting text from a textbox in which user write or copy some text which may contain special characters ( " , . ) etc. If there is any special character it get conflict with CommandText Syntax and generates error in inserting. I want to insert all these characters. How could i do it?
For reporting we used report RDLCs and displayed using an ASPX form. We implemented using the route as shown below. This resulted in forcing us to use the page route below and also to use the hyperlink instead of the normal Action Link. The question is how do we convert the asp:hyperlink ASPX syntax to Razor syntax.
When I format an accordion control using a skin file (as opposed to entering the formatting as attributes on each <asp:Accordion> tag), the control renders as expected when the website is run. However, in the VS2010 designer, the control won't display but instead shows the generic "Error Rendering Control" box which hasthe exception, "Collection was modified; enumeration operation may not execute."
I am working on a web page that handles alerts from National Weather Service. What I am wanting to do is when i drop a text file for watches and warnings, is to have the watches font color change from black to red and have the submenu also change.
example:watches>Middle Tennessee Watches
I want both of these to turn red if the file middletnwatches.txt exist. I know how to do the
Code:
if file.exists(server.mappath("middletnwatches.txt")) then
I have a Visual Studio 2010 and when I added a NEW project, VS gives me default css and UI themes. I have 6 aspx pages. Now whenever user is going into some specific page, I want the menu bar of that page to get highlighted so that user will know which page he/she is.I have a page called: CommSetup.aspx. In the page_load I have written this code:And in the master page I changed this: In code behind:
Now i am saving the country of the user in Session["Country"] variable , also i am using two labels and two textboxes , initially the labels text is ABN and other Label text is ACN , and initially the Textbox length against ABN Label is 14 and and ACN Label is also 14 , now i want that whenever the Session["Country"] changes to Pakistan , it must read the configurations of Pakistan node in xml file and set the ABN Label text to NTN and the textbox which is after it must allow 18 numeric digits only instead of 14 numeric digits , same for ACN Label change to BCN and textbox which is after it must allow 22 numeric digits only instead of 14 numeric digits
I have a class (let's call it Car) that has a property of type System.Drawing.Color (Call it CarColor). I have a script service function that uses this Car class as a return value, which works just fine. I then have another script service function that takes a Car object as a parameter. I would like to change the color of the car in Javascript, but I am finding it difficult to do so without adding another parameter that takes in the color as a string and is then translated at the server. Are there any ideas on how to set the Color property of the Car object in Javascript and maintain it through to the server?