Asp.net Webform Display Alert and redirect

前端 未结 4 723
清歌不尽
清歌不尽 2020-12-10 07:05

I\'m currently stuck. I have a webform with a button that registers or saves a record. What i\'d like to is have it display a javascript alert and then redirect to a page. H

4条回答
  •  时光取名叫无心
    2020-12-10 08:00

    This works perfect:

    string url = "home.aspx";
    ClientScript.RegisterStartupScript(this.GetType(), "callfunction", "alert('Saved Sucessfully.');window.location.href = '" + url + "';",true);
    

提交回复
热议问题