ASP. Net MVC and RegisterClientScriptBlock alternative

Posted by Noel on Stack Overflow See other posts from Stack Overflow or by Noel
Published on 2010-04-04T20:56:25Z Indexed on 2010/04/04 21:03 UTC
Read the original article Hit count: 409

Filed under:
|

I currently have a web form aspx page that calls RegisterClientScriptBlock. This sends down message text that I use for client side validation e.g.

    <script type="text/javascript">
    //<![CDATA[
    var c_errorMessages = {
        RequiredField : "* Mandatory field"
    };
    //]]>
    </script>

The values are generated on the server side based on culture and resource files. I believe you cannot use RegisterClientScriptBlock with MVC. Any ideas on how I can achieve this with MVC?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about asp.net-mvc-2