How do I use C# in Javascript? (Visual Studio 2017)

Asked

Viewed 2,790 times

3

I use little to organize my C code#:

#region Nome
 //seu código
#endregion

How can I do this by javascript and Razor ?

@if()
{
  //code javascript
}

Update:

I checked my answer Gypsy Morrison Mendez here and it didn’t work.

I downloaded and installed Web Essentials 2017.

And nothing happens:

inserir a descrição da imagem aqui

I’ve tried with Advanced Javascript Outlining and is not compatible with Visual Studio 2017.

2 answers

7


I found the solution for JS:

Obs: Only works with JS code. Won’t work with Razor.

Javascript Regions.

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui


Another solution is to use Visual Studio shortcut:

  1. Select your text you want.
  2. Tighten Ctrl + M and Ctrl + H.

inserir a descrição da imagem aqui

-1

Worked in an IDE of the game Screeps, will it work for Voce

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.