3

I am writing an ASP.NET MVC app. I am at the client side validation part. I found that when the UI flashes an error, it uses the class .input-validation-error.

What do I have to do in order to successfully make this class the same as what the jQuery UI uses for Alert CSS.

If you go to http://jqueryui.com/themeroller/ and look at the lower right you'll see an Alert box. What is the correct way to use this styling for my input validation error class?

I am very new to MVC so am not sure how to go about this

1 Answer 1

4

What I would do is put that line of code in partial view and pass the message or view model to that partial view.

<div id="error-effect" class="ui-widget">
    <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"> 
    <div style="margin-top:12px;">
    <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> 
    <strong>Error:</strong> 
    "Your message goes here"
   </p>
    </div>
    </div>
</div>

If you have imported the JQuery classes correctly, it should display the way it does on themeroller page.

Sign up to request clarification or add additional context in comments.

1 Comment

I'll udpate this post with credit as soon as I get a chance to try it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.