Hi i want to know if there's another way to redirect the ashx files to aspx page? .. because context.response.redirect is not working .. it only appears the inner code of the aspx page ...
//THIS IS MY CODE .. when entering the try, if there's no value it should go to catch after the catch i want to redirect the page to aspx ...
but its not working it just appear the code of the aspx not the whole page...
if (int.Parse(decrecord) == 0)
{
try { SqlCommand dbCom4 = new SqlCommand("sp_Sample2", sqlcon154);
dbCom4.CommandType = CommandType.StoredProcedure;
dbCom4.Parameters.AddWithValue("@rec_ID", idid_);
sqlcon154.Open();
//Retrieve the data in 192.168.9.154 Marketing_DB --> tblJob
SqlDataAdapter da4 = new SqlDataAdapter();
da4.SelectCommand = dbCom4;
DataSet ds4 = new DataSet();
da4.Fill(ds4, "dataset");
DataTable _dt4 = new DataTable();
_dt4 = ds4.Tables[0]; // This is the result of your query.
sqlcon154.Close();
recrec = _dt4.Rows[0][0].ToString();
_processDate = _dt4.Rows[0][13].ToString();
senderName_ = _dt4.Rows[0][24].ToString();
sender = _dt4.Rows[0][25].ToString();
subject = _dt4.Rows[0][26].ToString();
currentEdm = _dt4.Rows[0][28].ToString();
ranky = decrecord;
}
if theres no value it should go here and redirect to the page. but its not workin... theres another way to use redirect? thanks..
catch (Exception) { context.Response.Redirect("default.aspx"); }
breaker14
Member
107 Points
135 Posts
Handler ASHX.file redirect to aspx page or Site
Feb 18, 2012 02:50 AM|LINK
Hi i want to know if there's another way to redirect the ashx files to aspx page? .. because context.response.redirect is not working .. it only appears the inner code of the aspx page ...
//THIS IS MY CODE .. when entering the try, if there's no value it should go to catch after the catch i want to redirect the page to aspx ...
but its not working it just appear the code of the aspx not the whole page...
if (int.Parse(decrecord) == 0) { try { SqlCommand dbCom4 = new SqlCommand("sp_Sample2", sqlcon154); dbCom4.CommandType = CommandType.StoredProcedure; dbCom4.Parameters.AddWithValue("@rec_ID", idid_); sqlcon154.Open(); //Retrieve the data in 192.168.9.154 Marketing_DB --> tblJob SqlDataAdapter da4 = new SqlDataAdapter(); da4.SelectCommand = dbCom4; DataSet ds4 = new DataSet(); da4.Fill(ds4, "dataset"); DataTable _dt4 = new DataTable(); _dt4 = ds4.Tables[0]; // This is the result of your query. sqlcon154.Close(); recrec = _dt4.Rows[0][0].ToString(); _processDate = _dt4.Rows[0][13].ToString(); senderName_ = _dt4.Rows[0][24].ToString(); sender = _dt4.Rows[0][25].ToString(); subject = _dt4.Rows[0][26].ToString(); currentEdm = _dt4.Rows[0][28].ToString(); ranky = decrecord; } if theres no value it should go here and redirect to the page. but its not workin... theres another way to use redirect? thanks.. catch (Exception) { context.Response.Redirect("default.aspx"); }