Click here to Skip to main content
15,915,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My button click event is working well when i remove pgae.IsValid() in my code behind.But its not working in the presence of Page.IsValid() because my page.IsValid() always takes False.So my code written in my button click event is not working;
my code are as follows
C#
protected void btnGetDetails_Click(object sender, EventArgs e)
    {
        //to check server side validation if javascript is disabled
        Page.Validate();
       if (Page.IsValid == true)
        { gvEmployeeAttendance.DataSource = empAttendanceService.GetEmployeeAttendanceByDate(employeeID, fromDate, toDate);
            gvEmployeeAttendance.DataBind();
        }

//Code in My .aspx page
<asp:Button ID="btnGetDetails" runat="server" ForeColor="Blue" Text="Get Details" OnClick="btnGetDetails_Click" ValidationGroup="FilterAttendance" />
Posted
Updated 18-Feb-15 2:19am
v3
Comments
Suvendu Shekhar Giri 18-Feb-15 7:49am    
The issue doen't seem to me to have any relation with your code. Have you tried putting a breakpoint and debuging what happens?
Member 11246037 18-Feb-15 8:15am    
Yes,When I debug,Every time it takes the Page.IsValid=false.So it did not executes my code

1 solution

Just pass validation group name in Page.Valid();
Example-
Page.ISvalid("ValidationGroupName");
 
Share this answer
 
v2

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