如何用新选项卡/新窗口打开btnSMS.PostBackUrl?或者无论如何去那个URL然后自动去另一个页面?如何打开在新选项卡中打开链接?
更多信息:该URL是使用服务提供商(Clickatell)发送短信的方法。但是除了说明消息发送是否成功之外,URL没有任何其他内容。我不希望使用我的ASP.NET的用户卡在那里。我想让他们在发送消息后回到我的网站。
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
}
对不起,我不明白你的意思。有没有关于如何做到这一点的例子? – user1490374 2012-08-15 09:13:07
我更新了答案 – Madushan 2012-08-16 03:54:34