searchsanjaysharma
asked on
How to redirect the page to a link in this kind of situation,
I have html page. It reads the paremeter and transfer the control to .aspx page.
Once the data is saved, i want the message should come as
Record Submitted Successfully and then the page should be directed to index.aspx
The following code doesn;t gives the desired output.
if (!IsPostBack)
{
try
{
string sname = Request.Form["NAME"].ToStr ing();
string fname = Request.Form["FNAME"].ToSt ring();
string address = Request.Form["ADDRESS"].To String();
string landline = Request.Form["LANDLINENO"] .ToString( );
string contactno = Request.Form["CONTACTNO"]. ToString() ;
string email = Request.Form["EMAIL"].ToSt ring();
string academic = Request.Form["ACADEMIC"].T oString();
string sports = Request.Form["SPORTS"].ToS tring();
string activity = Request.Form["ACTIVITY"].T oString();
string dtype = Request.Form["DType"].ToSt ring(); ;
string course = "";
if (dtype == "Grad")
{
course = Request.Form["GCOURSE"].To String();
}
else if (dtype == "PostGrad")
{
course = Request.Form["PGCOURSE"].T oString();
}
else
{
course = Request.Form["DCOURSE"].To String();
}
string frm = Request.Form["FROMWHERE"]. ToString() ;
if (frm == "Others")
{
frm = Request.Form["OTHER1"].ToS tring();
}
string edu = Request.Form["Edu"].ToStri ng();
string Edu = "";
if (edu == "Any Other")
{
Edu = Request.Form["OTHER2"].ToS tring();
}
//procedure to save data
Response.Write("<script>al ert('Recor d saved successfully')</script>");
Response.Redirect("http://www.cu.com/")
}
catch (Exception ee)
{
Response.Write(ee.ToString ());
}
}
}
Once the data is saved, i want the message should come as
Record Submitted Successfully and then the page should be directed to index.aspx
The following code doesn;t gives the desired output.
if (!IsPostBack)
{
try
{
string sname = Request.Form["NAME"].ToStr
string fname = Request.Form["FNAME"].ToSt
string address = Request.Form["ADDRESS"].To
string landline = Request.Form["LANDLINENO"]
string contactno = Request.Form["CONTACTNO"].
string email = Request.Form["EMAIL"].ToSt
string academic = Request.Form["ACADEMIC"].T
string sports = Request.Form["SPORTS"].ToS
string activity = Request.Form["ACTIVITY"].T
string dtype = Request.Form["DType"].ToSt
string course = "";
if (dtype == "Grad")
{
course = Request.Form["GCOURSE"].To
}
else if (dtype == "PostGrad")
{
course = Request.Form["PGCOURSE"].T
}
else
{
course = Request.Form["DCOURSE"].To
}
string frm = Request.Form["FROMWHERE"].
if (frm == "Others")
{
frm = Request.Form["OTHER1"].ToS
}
string edu = Request.Form["Edu"].ToStri
string Edu = "";
if (edu == "Any Other")
{
Edu = Request.Form["OTHER2"].ToS
}
//procedure to save data
Response.Write("<script>al
Response.Redirect("http://www.cu.com/")
}
catch (Exception ee)
{
Response.Write(ee.ToString
}
}
}
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER