Click here to Skip to main content
15,889,838 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi How to include server side validation error(Code behind) message and validator control(aspx Page) message in validation summary

Aspx Page:
ASP.NET
 <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

C#
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
Updated 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

Read this article, its really awesome, perhaps this might help you,
ASP.NET Server Side Messages & Client Validation Message Handling.[^]
 
Share this answer
 
Comments
24983 20-Nov-12 23:53pm    
Thanks this is useful for me
[no name] 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900