` instead of `<% = string.Format (" {0}, {1} ", arg1, arg2)%>` in Aspx aspx pages On my asp...">

Is it permissible to use `<% =" {0}, {1} ", arg1, arg2%>` instead of `<% = string.Format (" {0}, {1} ", arg1, arg2)%>` in Aspx aspx pages

On my aspx pages, I often use the following and it works fine:

<%= "{0}, {1}", arg1, arg2 %>

I use ReSharper for code analysis. I just upgraded for v6.1 to 7 and this gives me the following two errors:

Expected Expression

The __ReSharper_Render method has 1 parameter (s) but is called with 3 arguments

Am I using the wrong syntax? I would prefer to continue to use it because I find it quite elegant and compact. If this is correct (I think it should be the way it works), any idea how to tell ReSharper to either ignore it or consider it valid?

+6
source share
1 answer

Saurabh, you are using ASP.NET implementation details. This is bad practice. It’s better to specify it explicitly:

 <%= string.Format("{0}, {1}", arg1, arg2) %> 
+4
source

All Articles