Friday, May 27, 2022

Clicking on button, restriction of moving from one page to another ScriptManager alert message

 using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Data;

using System.Data.SqlClient;

using System.Text;

using System.IO;

using System.Text.RegularExpressions;

using System.Web.UI.HtmlControls;

public partial class View_TrainingPartner_ManageInvoice_InvoiceInbox : System.Web.UI.Page

{

 protected void Page_Load(object sender, EventArgs e)

    {

 if (PANStatus == 0)

                {

                    ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('Please update your PAN No. before Invoice creation');", true);


                    #region redirectbtmeta

                    HtmlMeta meta = new HtmlMeta();


                    meta.HttpEquiv = "Refresh";

                    meta.Content = "1;url=../ManageCourses/TrainingPartnerProfileUpdate.aspx";


                    this.Page.Controls.Add(meta);

                    #endregion


try{}

catch{}


}
else
{
try
{}
catch{}
Response.Redirect("~/Login.aspx?errormessage=No valid session found", false);
}

}

}

No comments:

Post a Comment