TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
nishant ranjan
NA
390
0
Custom Validation
Dec 22 2011 1:10 AM
I am using custom validation. my problem is on save button data is inserted in table. e.isvalid=false in this case also data is inserted and in other case also. how can i use custom validation. so that if validation occurs data should not enter database.
.aspx
<asp:CustomValidator ID="cv_login" runat="server" ValidationGroup="add" Enabled="true" ControlToValidate="txt_username" OnServerValidate="cv_login_validate"></asp:CustomValidator>
.cs
protected void cv_login_validate(object sender, ServerValidateEventArgs e)
{
............
........
if (temp > 0)
{
e.IsValid = false;
}
else
{
e.IsValid = true;
}
}
button code
<asp:Button ID="btn_save" runat="server" Font-Bold="true" Text="Save"
onclick="btn_save_Click" ValidationGroup="add" style="height: 26px" CausesValidation="true"/>
Reply
Answers (
10
)
Burn the Particular Folder to cd/DVD using C#.net
Onfocus of Amount textbox i have to make alert as "select Product" if Product dropdown is not selected with any value