Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7891165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:32:54+00:00 2026-06-03T06:32:54+00:00

I wanna display error message with success image(green tick mark) and failure image(Red warning)

  • 0

I wanna display error message with success image(green tick mark) and failure image(Red warning) in validation summary. how to do this.
and i validation summary i will have to display some text in bold, italics etc. for that i tried to pass string like this.

inValid <b>username</b> or <b>password</b>

But in the page its rendering as it is. it is not showing username and password in bold. is there any way to do that. I am getting this validation error messages in controller and adding this to ModelState.add(error);

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:32:56+00:00Added an answer on June 3, 2026 at 6:32 am

    There is no doubt that @Darin Dimitrov answer is the best practice. but as a newbie i am gaining that functionaliy by using ViewBag
    Inside Controller

    if(true) //All is well and success msg is to be sent
    {
         ViewBag.Errors = null;
         ViewBag.Success = "<b>Login</b> is Successful";
    
         //Redirect
    }
    else
    {
         ViewBag.Errors = "<b>Some Error messages</b>";
         ViewBag.Success = null;
     }
    

    Inside View()

    @if(ViewBag.Errors != null)
    {
         <div class="error">@Html.Raw(@ViewBag.Errors)</div>
    }
    
    @if(ViewBag.Success != null)
    {
         <div class="success">@Html.Raw(@ViewBag.Success)</div>
    }
    

    Now the Css

    .error { color: red; background-image:error_image.png; }
    .success { color:green; background-image : success_image.png; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like add error message to page validation in order to display it
I wanna display a image from the internet how can I put it?
I just wanna display the contents of files from sdcard on emulator (as image
For example: If I've a string which is Unicode: \u4E45 I wanna display this
I wanna create the uitableview like this image . loading data from server and
Please help with below mentioned scenario-> I am having wanna display values from 1
When i click on a button in the repeater, i wanna display an ajax
I am using UIWebView to display pdf. I wanna handle touch events on webview.
I've got UpdatePanel with Div <telerik:RadAjaxPanel runat=server ID=RadAjaxPanel1> <div class=pnlFind style=display:none;> </div> </telerik:RadAjaxPanel> wanna
I simply wanna get the hour and minute from TimePicker and display it as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.