RadAjaxManager.Alert() not work

Posted by Vatcharm under ASP.NET AJAX on 3/2/2010 | Views : 6726 | Status : [Member] | Replies : 3
Hi Guru
I have this code:
RadAjaxManager1.Alert("complete");
RadAjaxManager1.Redirect("Default.aspx");

When I run webpage RadAjaxManager1.Alert("complete") not work.

Help me please.
Thank you very much.




Responses

Posted by: Vuyiswamb on: 3/2/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Do you get any javascript errors ?

Thank you for posting at Dotnetfunda
[Administrator]

Vatcharm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vatcharm on: 3/2/2010 [Member] Starter

Up
0
Down
NO I don't.
My code is
protected void btnGR_Click(object sender, EventArgs e)
{
//open conection
SqlConnection myCon = new SqlConnection(ConfigurationManager.ConnectionStrings["DCDBStr"].ToString());

myCon.Open();
try
{

DataTable dt = this.getInvoice();
if (dt.Rows.Count > 0)
{
//Group PONO for delete from good receive table
DataSetHelper dsHelper = new DataSetHelper();
DataTable dtGroupPO = dsHelper.SelectDistinct("tblGroupPO", dt, "PONO");
//Delete PONO from GoodReceive table and Stocks table
for (int j = 0; j <= dtGroupPO.Rows.Count - 1; j++)
{
string sqlStr = string.Format("DELETE FROM GoodReceives WHERE PONO='{0}'", dtGroupPO.Rows[j]["PONO"].ToString());
SqlCommand cm = myCon.CreateCommand();
cm.CommandText = sqlStr;
cm.ExecuteNonQuery();

string sqlStrDel = string.Format("DELETE FROM Stocks WHERE PONO='{0}'", dtGroupPO.Rows[j]["PONO"].ToString());
SqlCommand cmDel = myCon.CreateCommand();
cmDel.CommandText = sqlStrDel;
cmDel.ExecuteNonQuery();
}
//Loop for insert to table GoodReceive
GoodReceives gr = new GoodReceives();
for (int i = 0; i <= dt.Rows.Count - 1; i++)
{
gr.GRDate = txtGRDate.Text;
gr.PONO = dt.Rows[i]["PONO"].ToString();
gr.MaterialCode = dt.Rows[i]["MaterialCode"].ToString();
gr.GRQuantity = Convert.ToInt32(dt.Rows[i]["Quantity"].ToString());
gr.Username = Session["UserName"].ToString();
gr.VenderID = cboVender.SelectedValue.ToString();
gr.License = txtLicense.Text;
string sqlStrInsGR = string.Format("INSERT INTO GoodReceives(GRDate,PONO,MaterialCode,GRQuantity,Username,VenderID,License)VALUES('{0}','{1}','{2}',{3},'{4}','{5}','{6}')", gr.GRDate, gr.PONO, gr.MaterialCode, gr.GRQuantity, gr.Username, gr.VenderID,gr.License);
SqlCommand cm2 = myCon.CreateCommand();
cm2.CommandText = sqlStrInsGR;
cm2.ExecuteNonQuery();

}
RadAjaxManager1.Alert("complete");
RadAjaxManager1.Redirect("Goodreceive.aspx");

}
else
{
RadAjaxManager1.Alert("No Data");
}
}
catch (Exception ex)
{

if (myCon != null)
myCon.Close();
}
}

Vatcharm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sagarp on: 3/26/2010 [Member] Bronze

Up
0
Down

protected void Button1_Click(object sender, EventArgs e) 

{
string radalertscript = "<script language='javascript'>function f(){radalert('Delete Failed <b>Prometheus</b>!', 330, 210,'My Title'); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";
Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert", radalertscript);
}


Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Vatcharm, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response