Wednesday, September 28, 2022

Redirect to different page in ASP.NET C# - meta - or in HTML we can do

  HtmlMeta meta = new HtmlMeta();

                            meta.HttpEquiv = "Refresh";

                            meta.Content = "2;url=StudentList.aspx";

                            this.Page.Controls.Add(meta);

---------------------

redirecting of page from one to another with meta

 protected void btn_cancel_Click(object sender, EventArgs e)

    {

        #region redirectbtmeta

        HtmlMeta meta = new HtmlMeta();

        meta.HttpEquiv = "Refresh";

        meta.Content = "1;url=StudentList.aspx";

        this.Page.Controls.Add(meta);

        #endregion

    }


---------------------- In html we can do

<!DOCTYPE html>

<html>

   <head>

      <title>HTML Meta Tag</title>

      <meta http-equiv = "refresh" content = "2; url = https://kapooryash.blogspot.com" />

   </head>

   <body>

      <p>Hello HTML5!</p>

   </body>

</html>


ref:- https://www.tutorialspoint.com/How-to-automatically-redirect-your-visitors-to-your-new-home-page

Tuesday, September 27, 2022

File view on click in new tab with javascript with icon - Javascript PDF file view - How to open new tab in asp.net window.open

  <tr>

                                  <td>

                                      Updated List of NSQF Compliant ESDM Courses as on 15th September 2020

                                  </td>

                                  <td>

                                   <a href="javascript:void(0);" onclick="javascipt:window.open('Document/Admin/Updated_List_NSQF_ESDM_Course_150920.pdf');" target="_blank"><img src="images/pdf_sm_icon.png" alt="" align="absmiddle" /> Download</a>

                                  </td>

                              </tr>

                              <tr>


==============================

or you can go to new tab from one aspx page to another aspx page

<asp:Button runat="server" Text="test" OnClientClick="window.open('FileUploadToDatabase.aspx');" />