How to redirect to another page after a delay

前端 未结 3 1566
太阳男子
太阳男子 2021-02-15 12:43

I have a sign-in box in my webpage which is inside an UpdatePanel



        
3条回答
  •  北海茫月
    2021-02-15 13:35

    There are many ways to do this but I love to use this code because it works well when used in many different circumstances. This is with a 5 second delay.

    HtmlMeta oScript = new HtmlMeta();
    oScript.Attributes.Add("http-equiv", "REFRESH");
    oScript.Attributes.Add("content", "5; url='http://www.myurl.com/'");
    Page.Header.Controls.Add(oScript);
    

提交回复
热议问题