Docstoc

Disable code cleanup on aspx _amp; ascx

Document Sample
Disable code cleanup on aspx _amp; ascx Powered By Docstoc
					Disable code cleanup on aspx & ascx...


       Todd Smith 2 posts since
Apr 27, 2009
Is it possible to Disable code cleanup on aspx & ascx files?



Or customize the formatting style for aspx & ascx files?

Tags: cleanup, aspx, ascx


         Todd Smith 2 posts since
Apr 27, 2009 1. Re: Disable code cleanup on aspx & ascx files? May 27, 2009 8:04 PM

I realize now that the content within the <% %> tags is considered C# code and is getting
formatted with those rules. Is it possible to add some kind of pragma that disables formatting
for a specific file?



         jonny 1 posts since
Aug 7, 2009 2. Re: Disable code cleanup on aspx & ascx files? Aug 7, 2009 3:33 PM

Is it possible to disable resharper entirely from analyzing aspx/ascx/* files? With resharper
4.5 visual studio sometimes (well, pretty often actually) just dies on me when trying to open
large web projects. It seems like more people has the same problem too (http://jetbrains.net/
devnet/message/5238207, http://jetbrains.net/devnet/thread/282832?tstart=0).



A quick solution would be if I just could tell resharper to not inspect files with certain file
endings.



         Christian Crowhurst 32 posts since
Jun 19, 2006 3. Re: Disable code cleanup on aspx & ascx files? Apr 12, 2010 2:31 AM

Resharper guys,




Generated by Clearspace on 2011-09-09+04:00
                                                                                                  1
Disable code cleanup on aspx & ascx...


I think this issue needs serious attention. I think code cleanup has become almost useless
in ASP.Net MVC projects given that <% %> block code is common and these blocks are
now made entirely ugly by the c# reformating rules being applied to them. So much so that
unless there is some option to apply different formatting rules for code inside of aspx pages
OR formatting can be disabled for these pages, then I am going to have to advise my team
to stop using the feature for the MVC web app project. This is a BIG shame as its a feature I
like quite a lot.



And yes I know its possible to pick the files you want to clean, but this is generally
impractical. Its only really practical to reformat on a project or solution wide basis.



Please, please consider this for the near future (or now!).



Thanks

Christian



          Nicholas Cloud 4 posts since
Jul 29, 2010 4. Re: Disable code cleanup on aspx & ascx files? Aug 18, 2010 6:10 AM

I agree. There is nothing more frustrating than adding a <% } %> to finish out
Html.BeginForm() and have all markup inside the form go crazy because of formatting :-(



         Andrey Serebryansky 2,149 posts since
Jan 12, 2005 5. Re: Disable code cleanup on aspx & ascx files? Aug 20, 2010 2:04 PM

Hello Nicholas,



Could you please attach a small sample solution which would show this behavior?

Thank you!




Generated by Clearspace on 2011-09-09+04:00
                                                                                            2
Disable code cleanup on aspx & ascx...


Andrey Serebryansky

Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"



         I agree. There is nothing more frustrating than adding a <% } %> to

         finish out Html.BeginForm() and have all markup inside the form go


         crazy because of formatting



         ---

         Original message URL:

         http://devnet.jetbrains.net/message/5270431#5270431




         frank s 12 posts since
May 9, 2010 6. Re: Disable code cleanup on aspx & ascx files? Sep 7, 2010 8:59 AM

All .aspx pages have code cleanup, why do you need an example?



They are saying code cleanup makes mixing C# in ASPX/ASCX ugly, and they are
absolutely correct.




Generated by Clearspace on 2011-09-09+04:00
                                                                                    3
Disable code cleanup on aspx & ascx...


Please, +1, let us disable automatic code cleanup / formatting in ASPX/ASCX files.



         Andrey Serebryansky 2,149 posts since
Jan 12, 2005 7. Re: Disable code cleanup on aspx & ascx files? Sep 16, 2010 5:03 PM

Hello frank,



Could you please attach any particular example when code cleanup makes mixing

C# and aspx/ascx ugly? Thank you!



Andrey Serebryansky

Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"



         cleanup




         frank s 12 posts since
May 9, 2010 8. Re: Disable code cleanup on aspx & ascx files? Sep 16, 2010 8:45 PM

Sorry not to be more specific. I think code mixed in markup is ugly in general, but Resharper
takes away flexibility in how I format it, unless I want to constantly change it.



Generated by Clearspace on 2011-09-09+04:00
                                                                                            4
Disable code cleanup on aspx & ascx...




  For instance, if I want to generate a bunch of similar tabs in a loop... Any time I type in a
curly brace, the whole block of code gets reformater to resharpers preference. I would like
to keep the loop code tight, so it doesn't take too many lines and is readable:



  <% for (int i = 0; i < count; i++) { %>
     <div id="div<%= i %>"></div>
  <% } %>



 Resharper will frequently reformat the code as I type, and give me something like this:



  <% for (int i = 0; i < count; i++)
     {%>
     <div id="div<%=i%>"></div>
  <%
     }%>



  I really don't want a whole line for the curly brace, but thats what I get. It is true that my
code formatting is setup to have curly braces on the next line, that is my preference for CS
files, but in ASPX it is ghastly to read.



         Andrey Serebryansky 2,149 posts since
Jan 12, 2005 9. Re: Disable code cleanup on aspx & ascx files? Sep 20, 2010 5:12 PM

Hello frank,



Thank you very much for the example! Here's the issue you can monitor (or

vote): http://youtrack.jetbrains.net/issue/RSRP-191190. We will discuss how




Generated by Clearspace on 2011-09-09+04:00
                                                                                                   5
Disable code cleanup on aspx & ascx...


this problem can be addressed and when.



Andrey Serebryansky

Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"



         Sorry not to be more specific. I think code mixed in markup is ugly

         in general, but Resharper takes away flexibility in how I format it,

         unless I want to constantly change it.



         For instance, if I want to generate a bunch of similar tabs in a

         loop... Any time I type in a curly brace, the whole block of code

         gets reformater to resharpers preference. I would like to keep the

         loop code tight, so it doesn't take too many lines and is readable:



         <% for (int i = 0; i < count; i++) { %>

         <div id="div<%= i %>"></div>

         <% } %>

         Resharper will frequently reformat the code as I type, and give me

         something like this:




Generated by Clearspace on 2011-09-09+04:00
                                                                                6
Disable code cleanup on aspx & ascx...




         <% for (int i = 0; i < count; i++)

         {%>

         <div id="div<%=i%>"></div>

         <%

         }%>

         I really don't want a whole line for the curly brace, but thats what

         I get. It is true that my code formatting is setup to have curly

         braces on the next line, that is my preference for CS files, but in

         ASPX it is ghastly to read.



         ---

         Original message URL:

         http://devnet.jetbrains.net/message/5272503#5272503




Generated by Clearspace on 2011-09-09+04:00
                                                                                7

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:15
posted:9/12/2011
language:English
pages:7