Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to respose.Redirect to other page, but it didn't work. Here is my code behind


VB
Protected Sub gvList_RowCommand(sender As Object, e As GridViewCommandEventArgs)
        If e.CommandName = "cmdChoose" Then
            Response.Redirect("frmLogin.aspx")
        End If
    End Sub
Posted
Comments
Sergey Alexandrovich Kryukov 16-Sep-14 22:34pm    
What happens? Did you use the debugger to check if the handler is executed and CommandName matches?
—SA
U_Hanisa 16-Sep-14 22:42pm    
This is the error
"Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /frmLogin.aspx"
I'm not using '/' in my code behind. I also don't know why it cannot run

Check that the current form and Login Form must be in the same folder of application.
If they are not in the same folder the use Response.Redirect("~\FolderName\frmLogin.aspx")
 
Share this answer
 
Comments
U_Hanisa 17-Sep-14 0:05am    
yes, it is in the same folder
use thiz

HTML
Response.Redirect("~\Foldername\frmLogin.aspx")
 
Share this answer
 
Comments
U_Hanisa 17-Sep-14 0:16am    
I got it, thank you :)

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