ASP.NET MVC Page - hyper links in HTML.ValidationSummary
Posted
by Rita
on Stack Overflow
See other posts from Stack Overflow
or by Rita
Published on 2010-04-26T23:55:48Z
Indexed on
2010/04/27
0:33 UTC
Read the original article
Hit count: 746
asp.net-mvc
|asp.net-mvc-2
Hi
I have Registration page and if the validation fails, it displays the error messages using HTML.ValidationSummary control.
Now i have to display the Hyperlink in that Validation Error Message. But it is treating href also as string.
The Validation Message that I am trying to display with hyperlink is: **"User already exists in the system, please <a href='../Login.aspx'>login</a>"**
Appreciate your responses.
Here is my Code:
<% using (Html.BeginForm()) {%>
<%= Html.ValidationSummary(false) %>
<fieldset>
<div class="cssform">;
<p>
<%= Html.LabelFor(model => model.email)%><em>*</em>
<%= Html.TextBoxFor(model => model.email, new { @class = "required email" })%>
<%= Html.ValidationMessageFor(model => model.email)%>
</p>
<p>
<%= Html.Label("Confirm email")%><em>*</em>
<%= Html.TextBox("confirm_email")%>
<%= Html.ValidationMessage("confirm_email") %>
</p>
<p>
<%= Html.Label("Password")%><em>*</em>
<%= Html.Password("Password", null, new { @class = "required" })%>
<%= Html.ValidationMessage("Password")%><br />
(Note: Password should be minimum 6 characters)
</p>
<p>
<%= Html.Label("Confirm Password")%><em>*</em>
<%= Html.Password("confirm_password")%>
<%= Html.ValidationMessage("confirm_password") %>
</p><hr />
<% } %>
© Stack Overflow or respective owner