I have ASP.NET MVC controller named dictionary with method ControlsLangJsFile. Method returns view of users control (ASCX) which contain JavaScript variables.
When i call the method it returns variables with parsed strings, but Content Type is html/text. It should be: application/x-javascript
public ActionResult ControlsLangJsFile()
{
return View("~/Views/Dictionary/ControlsLangJsFile.ascx",);
}
How do i achieve this?
Users control doesn't accept ContentType="text/xml"
Solution:
public ActionResult ControlsLangJsFile()
{
Response.ContentType = "text/javascript";
return View("~/Views/Dictionary/ControlsLangJsFile.ascx");
}