新しいタブ/新しいウィンドウでbtnSMS.PostBackUrlを開く方法は?または、とにかくそのURLに移動してから、自動的に別のページに移動する方法はありますか?
詳細:そのURLは、サービスプロバイダー(Clickatell)を使用してSMSを送信する方法です。しかし、URLには、メッセージの送信が成功したかどうかを示す以外に何もありませんでした。ASP.NETを使用しているユーザーがそこにとどまってほしくありません。メッセージを送信した後、彼らが私のWebサイトに戻ることを許可したいと思います。
protected void btnSMS_Click1(object sender, EventArgs e)
{
String HP = txtHP.Text;
String URL = "http://api.clickatell.com/http/sendmsg?user=myuser&password=mypassword&api_id=myapi_id&to=";
String Text = "&text=" + txtSMS.Text;
btnSMS.PostBackUrl = URL + HP + Text;
string username;
//Sql Connection to access the database
SqlConnection conn6 = new SqlConnection("MY CONNECTION");
//Opening the Connnection
conn6.Open();
string mySQL;
username = HttpContext.Current.User.Identity.Name;
//Insert the information into the database table Login
mySQL = "INSERT INTO Table_Message(Username, Message, Title, SendTo) VALUES('" + username + "','" + txtSMS.Text.Trim() + "','" + txtTitle.Text.Trim() + "','" + txtHP.Text.Trim() + "')";
SqlCommand cmdAdd = new SqlCommand(mySQL, conn6);
//Execute the sql command
cmdAdd.ExecuteNonQuery();
//Close the Connection
}