Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to have Visual Studio TODO comments in aspx/ascx files appear in task list?

We develop asp.net webforms using visual studio 2008. For multilingual support, we translate all our text. However, when designing, we usually just enter the english text and come back to translation later (it interrupts flow of work otherwise).

I've added a "ToTranslate" tag in the options. Adding //ToTranslate: something in C# code correctly adds the entry to the Task List. I haven't however figured out how to do the same for aspx and ascx files (where most of our user text lives).

Inserting <%-- //ToTranslate: something --%> or <%-- ToTranslate: something --%> doesn't work.

Any ideas?

like image 870
srmark Avatar asked May 28 '09 21:05

srmark


People also ask

How do you add a TODO comment in Visual Studio?

Visual Studio Tracks Your “// TODO” Comments From within Visual Studio Go to View -> Task List. This will display the Task List window and show you any area of your open Solution that has existing comments that start with // TODO . You can filter down to your Current Project, Current Document, or Open Documents.

How do you add a TODO comment in HTML?

TODO comments are just code comments that start with a single string of capital letters like // TODO or // FIXME.

What is task list in Visual Studio?

Visual Studio provides several tool windows helping developers to keep track of their project. Task list collects information from source code, so it is available at one place all together.

How do you write Todo in C++?

Place the cursor somewhere in the source, then either a right mouse click and select "Add ToDo Item" or just Shift+Ctrl+T. Just embed C/C++ style comments within your code that are prefaced by the identifier "TODO:".


2 Answers

It seems to me that it works fine if you put the delimiters <% and %> on a line by themselves. What I did was this: go to Tools menu and click on Options, then under Environment -> Task List add a new ToTranslate token. Click OK to accept the change. Back on the ASPX page I added the comments on a line by themselves and the code delimiters on lines by themselves.

like image 183
λ Jonas Gorauskas Avatar answered Oct 26 '22 02:10

λ Jonas Gorauskas


FYI if you want to do this in a .Net MVC3 razor cshtml file the syntax this:

@{
//TODO: Move this inline <style> css to a file
}

Take note: that you need to put the trailing } bracket on a new line as otherwise it will be included in the // comment. You could do it using /**/ like below and keep it all on one line but it's more typing, and a bit harder to read. My take is, if it annoys you the comment takes up 3 lines in your file, all the more motivation to fix the issue and remove it completely :)

@{/*TODO: Move this inline <style> css to a file*/}
like image 32
SavoryBytes Avatar answered Oct 26 '22 02:10

SavoryBytes