Click here to Skip to main content
12,813,626 members (32,881 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET
How to include server side validation error(Code behind) message and validator control(aspx Page) message in validation summary

Aspx Page:
<asp:label id="lblerror" runat="server">
          <asp:validationsummary id="valsum" runat="server" validationgroup="settingsProduct"\>

<asp:textbox id="username" runat="server"\>
<asp:Requirefieldvalidator id="Requsername" controltovalidate="username" validationgroup="settingsProduct">
<asp:button id="btnclick" onclick="btnclick_click" runat="server"\>

Now i check username is available in db and display error message in label

Public void btnclick_click(object 0,Eventargs e)
     lblerror.text="User ID is not found";

My Question :
Now display separate label error message and validation summary.
Can we combine both error message?
Plz help me...I have no idea...
Posted 20-Nov-12 7:05am
Updated 20-Nov-12 18:41pm
Sergey Alexandrovich Kryukov 20-Nov-12 13:53pm
Include? Not clear. Could you use "Improve question", above?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Read this article, its really awesome, perhaps this might help you,
ASP.NET Server Side Messages & Client Validation Message Handling.[^]
santhosh19783 20-Nov-12 23:53pm
Thanks this is useful for me
Krunal R 20-Nov-12 23:55pm
ok, rate the solution and accept it.. :) Good Luck Mate :)
pradiprenushe 21-Nov-12 0:44am
Good solution my 5+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100