Home > DeveloperSection > Forums > When ever a redirect page automatically send sms World wide using asp.net?
anil babu
anil babu

Total Post:19

Points:133
Posted on    October-09-2012 1:40 AM

 ASP.Net ASP.Net 
Ratings:


 2 Reply(s)
 2573  View(s)
Rate this:
I have URL like this http://127.0.0.1:81/Redirect.aspx?TagId=1,
In that I am passing querystring parameter value comming from database,
Based on tad id It will display Another column is their in database(URL)

My question is I want to changing query string parameter One page will open(That page url comming from database table)along with that one I will send sms to number based on TagId

MYProgram:
Page1.aspx <asp:GridView ID="QS1" runat="server" AutoGenerateSelectButton="True" AutoGenerateColumns="false" onselectedindexchanging="GvDept_SelectedIndexChanging"> .cs protected void Page_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection(@"Data Source=<>;Initial Catalog=productdb;Persist Security Info=True;User ID=<>;Password=<>"); SqlDataAdapter da = new SqlDataAdapter("select * from redirecturl", con); DataSet ds = new DataSet(); da.Fill(ds, "redirecturl"); QS1.DataSource = ds.Tables["redirecturl"]; QS1.DataBind(); QS1.DataKeyNames = new string[] { "Tagid" }; } protected void GvDept_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { QS1.SelectedIndex = e.NewSelectedIndex; string Dno = QS1.SelectedValue.ToString(); Response.Redirect("~/Page2.Aspx?TagId="+Dno); } Page2.aspx <div> <asp:GridView ID="QS2" runat="server" EmptyDataText="There Are No Employees In Selected Department" AutoGenerateColumns="false" Width="99px"> <br /> <iframe width="100%" runat="server" id="ifrmBrs">your browser does not support IFRAMEs</iframe> </div> .cs String URL = ""; 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 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.ToString(); } con.Close(); if (!String.IsNullOrEmpty(URL)) { //Use Iframe if it works ifrmBrs.Attributes["src"] =URL; } } I am trying this one
My QUESTION IS tABLE Tagid coupounurl phonenumber 1 http://page4.aspx 655666666 2 http://page5.aspx 67867668 3 http://page6.aspx 6868769879 Based on tag id Redirect perticular url, In redirect perticular url based on TagId I want to send sms to perticular pnonenumber(Worldwide) I dont known idea on sending sms plz help me ........


John Smith

Total Post:102

Points:720
Posted on    October-13-2012 9:03 AM

Have you purchased any third party service to send SMS ?

anil babu
anil babu

Total Post:19

Points:133
Posted on    October-14-2012 9:56 PM

No,
First It's working fin After that I am Purchasing to service,
Present I am Trying this code,
public void send(string uid, string password, string message, string no)
        {
            
          HttpWebRequest myReq =(HttpWebRequest)WebRequest.Create("http://ubaid.tk/sms/sms.aspx?uid=" + uid + "&pwd=" + password +"&msg=" + message + "&phone=" + no + "&provider=way2sms");

          HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse();
          StreamReader respStreamReader = new StreamReader(myResp.GetResponseStream());
          string responseString = respStreamReader.ReadToEnd();
          respStreamReader.Close();
          myResp.Close();
         }
protected void Button1_Click(object sender, EventArgs e)
        {           
            send("<PhoneNumber>","anil", TextBox2.Text, TextBox1.Text);
        }

Don't want to miss updates? Please click the below button!

Follow MindStick