1

In spite of having web essential & productive power tool installed for Visual Studio 2012, javascript code with in aspx page doesn't indent automatically.

This is how I type:

for (var i=0;i<=10;i++)
{
}

This is how I want to indent:

for (var i = 0; i <= 10; i++){
}

I am not sure which extension for VS 2012 used to do it on my older PC. The moment I type, end curly brace, it will indent my javascript code automatically. I did look at settings but didn't get it right

Can anyone help me out?

2
  • By "didn't get it right" do you mean you didn't find the settings or you did but it didn't work? Commented Jan 22, 2015 at 5:09
  • If I go by features, it is stated that VS 2012 or web essential take care of indentation but it is not working. I am not sure if I had any other extension which was doing that for me. Commented Jan 22, 2015 at 5:51

1 Answer 1

1

try Tools | Options | Text Editor| Javascript | Formatting | New Lines gives you the option to put an open brace on a new line. Uncheck that option and see if that works.

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

1 Comment

Try Tools | Options | Text Editor | File Extension and register the file type you are working on as script editor

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.