0
我在添加對包含單個文件Web表單的應用程序中的庫引用時遇到了麻煩。在單個文件中添加引用ASP.NET Web表單
我有一個onClick事件處理程序,我想添加一個我無法做的WebClient類的引用。以下是我的單擊事件處理程序的代碼:
<script runat="server">
protected void submitBtn_Click(object sender, EventArgs e)
{
try
{
string url = "http://anydomain.net/REST/message_send.aspx?API_KEY=anykey&name=" + name_box.Text + "&email=" + email_box.Text + "&website=" + website_box.Text + "&message=" + msg_box.Text + "";
var client = new WebClient();
string reply = client.DownloadString(url);
msg_lbl.Text = "Request submitted. Our representative will get back to you soon.";
msg_lbl.Visible = true;
}
catch (Exception ex)
{
}
}
</script>