Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2013 Format Document converts attributes to lowercase in MVC

For some odd reason, Visual Studio 2013 keeps converting the following line of code:

<input type="button" value="@T("Checkout.ShipToThisAddress")" class="button-1 select-shipping-address-button" onclick=" setLocation('@Url.RouteUrl("CheckoutSelectShippingAddress", new {addressid = item.Id})') " />

To this:

<input type="button" value="@T("Checkout.ShipToThisAddress")" class="btn-default-1 pull-right" onclick=" setlocation('@url.routeurl("checkoutselectshippingaddress", new { addressid = item.id })') " />

Note that tag attribute names as well as content are lower case. Also, Visual Studio complains that the line is missing a double-quote only in the editor. Here's the generated output:

<input type="button" value="Bill to this address" class="btn-default-1 pull-right" onclick="setLocation(' /checkout/selectbillingaddress?addressid=10856 ') ">

I tried to use the following suggestions, but it applies only to ASP not MVC pages. I couldn't find an MVC option in the Text Editor options in VS 2013.

Format Document in Visual Studio 2010 asp tags format to lowercase

like image 699
ATL_DEV Avatar asked Nov 09 '22 19:11

ATL_DEV


1 Answers

There is a setting in Tools > Options > Text Editor.

Within the HTML (Web Forms) section, select 'Formatting' and you can set 'Capitalization' for various items including 'Client attributes'

It appears to default to 'Lowercase' but you can change it to 'As entered'.

like image 60
Bonneville Avatar answered Nov 15 '22 05:11

Bonneville