을 작동하지 않습니다 나는 다음과 같은 C# 코드를 가지고 :Reponse.Redirect 즉시 C#
string ProfileID, UserID;
try
{
ProfileID = Request.QueryString["ProfileID"].ToString();
string SelectQuery;
DataSet ds;
try
{
UserID = Session["UserID"].ToString();
if (ProfileID == UserID)
{
Response.Redirect("user/Default.aspx", true);
return;
}
else
{
//some code here
}
}
finally
{
//some code here
}
}
catch {
Response.Redirect("DoesNotExists.aspx");
}
여기서 문제는 그 조건은 대신 리디렉션이에 사실 (if (ProfileID == UserID)
), 코드 cotinue 실행하고있는 경우 라인 : Response.Redirect("user/Default.aspx", true);
redicet이 줄에 : Response.Redirect("DoesNotExists.aspx");
내 질문은 어떻게 고칠 수 있습니다.
도움을 청하십시오! 감사합니다.
실제 예외를 캡처 할 수 있습니까? 'catch (Exception ex)'는 모든 예외를 잡아서 무엇이 잘못되었는지 알려줍니다. –
감사합니다. 그러나 다른 해결책이 있습니까? –