Click here to Skip to main content
12,305,151 members (72,858 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
Hi
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"\>
C#
---
Now i check username is available in db and display error message in label

Public void btnclick_click(object 0,Eventargs e)
{
    if(username)
   {
     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 6:05am
24983743
Edited 20-Nov-12 17:41pm
v3
Comments
Sergey Alexandrovich Kryukov 20-Nov-12 13:53pm
   
Include? Not clear. Could you use "Improve question", above?
--SA

1 solution

Rate this: bad
 
good
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.[^]
  Permalink  
Comments
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.160530.1 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2016
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