I am having a very strange problem with the Visual Studio editor. I am working with Visual Studio 2010 SP1.
Every once in a while, while editing the source code of an ASPX page in code view (showing the HTML tags), very strange things happen. For example, I have right now this lines of code:
Analysing what happened, I see a block of about 30 lines of code has been duplicated in the web form and inserted between "<h3>Productos" and "</h3>".
If I open the last actions list in the undo list, I see the last one is "Update design view" ("Actualizar vista diseño", in Spanish is what I actually read). If I undo the action, everything goes back to normal.
Is there any reason for this to happen? Can this be fixed?
if this is not due to strange VS behaviour... (something which happens with no reason)
then, I think you might have some code snippet added in your project... with some shortcut text...
VS 2010 has code snippet feature... which lets u store the frequently used code snippets and add in u r current file on the go... it also lets u set the shortcut string so that, whenever u type that shortcut string within u r code and press tab, then it
replaces that string with code snippet...
dcarbonell
0 Points
11 Posts
Visual Studio editor strange problem
Dec 24, 2012 08:37 AM|LINK
Hi,
I am having a very strange problem with the Visual Studio editor. I am working with Visual Studio 2010 SP1.
Every once in a while, while editing the source code of an ASPX page in code view (showing the HTML tags), very strange things happen. For example, I have right now this lines of code:
(...)
<tr>
<td align="left">
<h3>Productos</h3>
</td>
<td align="center">
</td>
</tr>
(...)
Everything OK, but then, for some reason, all of a sudden, some strange action fires in the editor and the code gets all messed up, showing this:
<tr>
<td align="left">
<h3>ProductosMaskedEditExtender>
</FooterTemplate>
<InsertItemTemplate>
Insert item!!!</InsertItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="Descripción">
<ItemTemplate>
<label runat="server" id="lblDescripcionItem">
<%# Eval("descripcion")%></label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtDescripcionEdit" runat="server" Text='<%# Bind("descripcion") %>' Width="500px" />
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtDescripcionAlta" runat="server" Text='<%# Bind("descripcion") %>' Width="500px" />
</FooterTemplate>
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
Añadir periodo de Adhesión <asp:LinkButton ID="btnNuevoPeriodoAd" runat="server" CausesValidation="False" CommandName="New" Text="Añadir periodo de Adhesión">
<img src="../Img/nuevo.jpg" />
</asp:LinkButton>
</EmptyDataTemplate>
</asp:GridView>
</asp:Panel>
<%-- AAA
<asp:CollapsiblePanelExtender ID="colPanExtPeriodosAd" runat="server" TargetControlID="panPeriodosAd" CollapsedSize="0" ExpandedSize="300"
Collapsed="True" ExpandedImage="~/Img/minus.png" CollapsedImage="~/Img/plus.png" TextLabelID="lblPanPeriodosAd"
CollapsedText="Mostrar periodos de adhesión" ExpandControlID="imgMostrar" CollapseControlID="imgOcultar"
ExpandedText="Ocultar" ImageControlID="imgPanPeriodos">
</asp:CollapsiblePanelExtender>--%>
</td>
</tr>
<tr>
<td align="left">
<h3>Productos</h3>
</td>
Analysing what happened, I see a block of about 30 lines of code has been duplicated in the web form and inserted between "<h3>Productos" and "</h3>".
If I open the last actions list in the undo list, I see the last one is "Update design view" ("Actualizar vista diseño", in Spanish is what I actually read). If I undo the action, everything goes back to normal.
Is there any reason for this to happen? Can this be fixed?
Thanks in advance,
Daniel Carbonell
kedarrkulkar...
All-Star
35573 Points
5700 Posts
Re: Visual Studio editor strange problem
Dec 24, 2012 11:10 AM|LINK
if this is not due to strange VS behaviour... (something which happens with no reason)
then, I think you might have some code snippet added in your project... with some shortcut text...
VS 2010 has code snippet feature... which lets u store the frequently used code snippets and add in u r current file on the go... it also lets u set the shortcut string so that, whenever u type that shortcut string within u r code and press tab, then it replaces that string with code snippet...
check if u have set a code snippet
http://msdn.microsoft.com/en-us/library/ms165394.aspx
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
dcarbonell
0 Points
11 Posts
Re: Visual Studio editor strange problem
Jan 02, 2013 07:45 AM|LINK
Thanks, kedarrkulkarni.
I checked what you suggested, but I don't any code snippet enabled.