redirect from a cs fiel?
-
Hey I have an ASP.NET application with a DBConnection.cs(
public class DBConnection : System.Web.UI.Page
) file! This class is used by other aspx pages. When an error accures in the DBConnection.cs I want my errorMessage.aspx to be displayd with my error message(Session["ErrorMessage"] = errorstring;) When i try Response.Redirect("ErrorPage",false); it says that this method is not available in this context? How do i solve this the nice way? or shold i just use delegates so the aspx page is redirecting instead? Best Regards Jimmy -
Hey I have an ASP.NET application with a DBConnection.cs(
public class DBConnection : System.Web.UI.Page
) file! This class is used by other aspx pages. When an error accures in the DBConnection.cs I want my errorMessage.aspx to be displayd with my error message(Session["ErrorMessage"] = errorstring;) When i try Response.Redirect("ErrorPage",false); it says that this method is not available in this context? How do i solve this the nice way? or shold i just use delegates so the aspx page is redirecting instead? Best Regards JimmyHi, for example, if your class is used by errorpage.aspx. then you view the write to session("errorMessage") in the errorpage.aspx Then, when the error occurs, we call Response.redirect("errorpage.aspx") to redirect to the errorpage to show the error message in which you have saved in Session("errorMessage") Ich liebe .NET :)
-
Hi, for example, if your class is used by errorpage.aspx. then you view the write to session("errorMessage") in the errorpage.aspx Then, when the error occurs, we call Response.redirect("errorpage.aspx") to redirect to the errorpage to show the error message in which you have saved in Session("errorMessage") Ich liebe .NET :)
Hey! Yes its like that i whant it to work, but when i try to cal the Response.redirect in my DBConnection.cs (Regular C# class) then it says that this action is not valid in that context. Do i have to make my DBConnection to a aspx form to be abled to use Response.redirect? Or is there a way to redirect to a aspx page from a cs(regular C# class) ?? //Jimmy