In VS 2012 and earlier i was able to press CTRL+K, CTRL+D which would change
<div>
<div>
<asp:TextBox runat="server" Id="Textbox1"></asp:/TextBox>
</div>
</div>
to
<div>
<div>
<asp:TextBox runat="server" Id="Textbox1"></asp:/TextBox>
</div>
</div>
So it would remove the extra lines. In VS 2013 when i do the same it doesn't format it correctly (or in the way i prefer).
I've looked under Tools but nothing that i can see that would sort the issue, i also have Productivity Power Tools installed and again no option to remove the extra lines.
Anyway around this?
Edit 1
using \n\n and \n
Under Windows, line endings are \r\n. To search for blank lines, search for ^\r\n with regular expressions on and replace with a blank string.
Note: the Replace... shown is an empty string placeholder.
Related
when I use a single view file with uni-code in it, it shows the the content correctly but when I make a layout and extends with it from another page it doesn't show the uni-code character it shows ????
#extends('layouts/custom_layout.blade')
Check what encoding is used in your other view. Convert it to UTF-8 and it will work fine.
To avoid encoding related problems, use popular IDEs or text editors like Sublime Text or Notepad++ for editing files.
In custom_layout.blade.php file:
````
<div class="container">
<div class="content">
<div class="title">Laravel 5</div>
गृह
</div>
</div>
````
In home.blade.php file:
#extends('custom_layout')
And off course I have used meta tag charset="utf-8" in head tag.
My friend I had the same problem with the unicode characters it turns out that the IDE was causing the problem , I use Jetbrains PHPStorm. I edited the file with sublime and it turns alright.
I have this line of HTML
<input id="checkVSC" type="checkbox" checked data-toggle="toggle" name="checkVSC"
data-onstyle="info" data-offstyle="default" data-size="small"
data-on="<i class='icon icon-checkmark'></i> VSC"
data-off="<i class='icon icon-line-plus'></i> VSC">
for the data-on it gives me the green squiggly line saying: "If the attribute value is enclosed in quotations marks, the quotation marks must match"
This isn't a major item, but when I do Ctrl-K Ctrl-D to re-format the lines of code to make them neat and pretty it adds a ">" to the data-on attribute.
<input id="checkVSC" type="checkbox" checked data-toggle="toggle" name="checkVSC"
data-onstyle="info" data-offstyle="default" data-size="small"
**data-on="><i class='icon icon-checkmark'></i> VSC"**
data-off="<i class='icon icon-line-plus'></i> VSC">
Any one have any idea as to what is going on here and why it is doing what it is doing?
VS gets fooled because your HTML is invalid.
Attribute strings should be escaped:
data-on="<i class='icon icon-checkmark'></i> VSC"
data-off="<i class='icon icon-line-plus'></i> VSC">
To avoid such situations in the future You might try to:
enable HTML validation
try any online validator
Some other IDEs and text editors provide automatic validation and even automatic escaping as well.
just a little one.
Visual studio's auto formatting takes the below line of code:
<li>All Catered Chalets</li>
and turns it into this line of code:
<li>
<a href=""
<?php print $directorylifts; ?>catered-chalets/index.php">All Catered Chalets
</a>
</li>
Note how it's inserted an extra quotation mark after the href= so the code no longer works.
I could just turn off the auto formatting but I find it helpful. Any ideas how to adjust it to stop this happening?
my files have the .php extension.
Thanks,
Phil.
I am wondering if there is any way to stop Visual Studio 2010 from appending a number to the end of the ID on new controls I create. For example, when I add a new TextBox, I would prefer that it do this:
<asp:TextBox ID="TextBox" runat="server">
<asp:TextBox ID="TextBox" runat="server">
<asp:TextBox ID="TextBox" runat="server">
Instead of this:
<asp:TextBox ID="TextBox1" runat="server">
<asp:TextBox ID="TextBox2" runat="server">
<asp:TextBox ID="TextBox3" runat="server">
It would make it easier to rename them appropriately, so I don't have to arrow/mouse over and delete the number each time. As I was writing this, the "Questions that may already have your answer" suggested this:
How do I prevent Visual Studio from renaming my controls?
which admittedly was the biggest part of my annoyance, but that appears to turn off putting in an ID="" field altogether, not just for pasted controls. It would still be helpful to turn off the numbering for new, non-pasted controls and have it not rename pasted ones as well. At the moment I'm working with ASP.NET, but it would be nice if it there was a way to do it for WinForms as well.
Before anyone suggests it, I do know that allowing it to append the numbers prevents name conflicts should I not rename them appropriately. However, I would much rather have it fail to compile so I know to fix the issue now (if I forget to name something properly) rather than find random "TextBox1" items lying around in the code later on.
in visual studio goto:
Tools > Options > Text Editor > HTML > Miscellaneous
Uncheck 'Auto ID elements on paste in Source view'.
The issue I am having is that when I create a multiline textbox, it prepends
(carriage return line feed) characters.
I am using .NET 4.5. I created an empty project with just a multiline textbox:
<asp:TextBox ID="txtTest" runat="server" TextMode="MultiLine" Rows="5" Columns="50"></asp:TextBox>
In firefox and chrome it renders as:
<textarea name="txtTest" rows="5" cols="50" id="txtTest">
</textarea>
In IE, it is fine.
Thank you in advance.
Like jmoreno suggested, changing
controlRenderingCompatibilityVersion=4.0
to
controlRenderingCompatibilityVersion=4.5
in web.config helped me.
this is fixed in .NET 4.5 RTM version. Are you using 4. RC? Connect issue fixed in RTM
The initial leading newline (LF or CRLF) of a textarea is ignored.
IE 8 and other older browsers (e.g. Firefox 3) remove the leading newline after parsing character entities.
However newer browsers removing the leading newline before parsing character entities, which then get interpreted as part of the default value of the textarea.
I don't know why .NET would generate those character entities.