Articles in this section
Category / Section

How to avoid the error message "CS1502:The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write" having invalid arguments?

3 mins read

Compiler Error Message: CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments.


The error message above is obtained since .Render() is mentioned in the .cshtml page.


The parenthesis used in Html helper (“@(Html.EJ“) defines an explicit expression and the curly brackets(“@{Html.EJ“) defines a regular C# code block. The difference is that the explicit expression submits its output directly as a part of the HTML markup and the code block does not submit it directly.

(@(Html.EJ- Returns the MvcHtmlString, so it must be called inside parenthesis.

(“@{Html.EJ- Renders directly to view internally and returns void.

In Essential Studio, the HtmlString in Render() method is returned. So it returns null and the Grid does not appear. So in order to avoid the above mentioned error, use parenthesis instead of the curly brackets.


But in the latest release, Volume 2, 2014 version, the Render() method using void return type is updated. The changes made in v12.2.0.36 in the release notes can be tracked using the following links.

Release Notes:

API Changes Documentation!documents/apichangesdetails.htm

Online Sample Link


Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment