在 Web 应用程序 [asp.net] 中,我编写代码以重定向到解决方案中的其他页面,但它给出了异常。
Response.Redirect("abc.aspx");
你能帮帮我吗,谢谢。
WeeklyAttendanceMailStatusBE obj = new WeeklyAttendanceMailStatusBE();
obj.CreatedBy = Session["xxx"].ToString();
obj.Sesssionid = Session.SessionID.ToString();
obj.StatusDate = Convert.ToDateTime(DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day.ToString() + " " + DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString() + ":" + DateTime.Now.Second.ToString());
obj.Types = "Insert";
if (radLastWeek.Checked == true)
{
obj.Flags = 1;
obj.LastWeekStatus = 1;
int result = new WeeklyAttendanceMailStatusBL().InsertWeeklyAttendanceMailStatus(obj);
if (result > 0)
{
Response.Redirect("abc.html");
}
else
{
DateTime dt = DateTime.Now;
ScriptManager.RegisterStartupScript(this, GetType(), "message", "<script> alert('Not Submited Mail Status')</status>", false);
}
}
else
{
}