1

I'm using ASP.NET MVC 3 and I have one JavaScript-file for each view and each partial view. So if I have the following files:

User.cshtml
User.js
_EditUser.cshtml
_EditUser.js

Now, I want to have intellisense in file '_EditUser.js' for functions and variables defined in 'User.js'. Is that possible?

1 Answer 1

1

Try to add

/// <reference path="User.js" />

to the top of _EditUser.js

Update: To see more than names of variables and functions of User.js you need to add special comments with tags. They are like usual comments for documenting C# code in Visual Studio. One of minor differences is this comments are inside function body not before. You can see it in jQuery-with-doc-file as you mentioned in comment.

function Some(key, value)
{
   /// <summary>Function do some value with key</summary>
   /// <param name="key" type="String">Key argument</param>
   /// ... and so on ...

}
Sign up to request clarification or add additional context in comments.

2 Comments

I already tried that one, didn't work. I guess, I have to do it like the jquery-doc-File...
Yes you need to document your vars and functions. But at least (with reference sign) you can see variables name and function signatures of User.js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.