Your code fetches the URL from the database. Now you need to make a small change in the above code to fetch the phone number from the database. Add the extra column name 'phonenumber' to it . Here it is
protected void Page_Load(object sender, EventArgs e)
{
string Dno = Request.QueryString["TagId"];
SqlConnection con = new SqlConnection(@"Data Source=<>;Initial Catalog=productdb;Persist Security Info=True;User ID=<>;Password=<>");
SqlCommand cmd = new SqlCommand("select coupounurl, phonenumber from redirecturl where Tadid=" + Dno, con);
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
QS2.DataSource = dr;
QS2.DataBind();
dr.Close();
object drReader = cmd.ExecuteScalar();
if (drReader != null)
{
URL = drReader["couponurl"].ToString();
phonenumber = drReader["phonenumber "].ToString();
}
con.Close();
if (!String.IsNullOrEmpty(URL))
{
ifrmBrs.Attributes["src"] =URL;
Session ["phonenumber "]=phonenumber;
}
}
Then redirect to Response.Redirect(URL);
Then on the Page_Load of the redirected page, you can call the webservice to send SMS. Remember that SMS cannot be sent through asp.net alone. You need to buy a SMS service and integrate it into asp.net application