在我的Web應用程序,我有,我有對BTN點擊我打電話,一個ASCX web用戶控件我使用的是JavaScript的,通過它我試圖在同一發佈的數據按鈕,點擊主aspx頁面ascx,因爲我知道我們可以在ascx頁面發佈數據..但我想發佈如何可能嗎?如何將數據從ASCX javascript發佈到相同的ascx控件?
xhr.open('POST', '../test.ascx?Id=' + <%=Id%>, true); //Id is the property in ascx page
xhr.setRequestHeader('FILENAME', file.name);
xhr.send(file);
的OnInit和..
if (!string.IsNullOrEmpty(Request.Headers["FileName"]))
{
string Name = Request.Headers["FileName"].ToString();
Stream Stream1 = Request.InputStream;
Add(Name, Stream1, Id);
}
ASCX ???你不能訪問用戶控件,因爲它們不是從外部路徑訪問..你應該使用HttpHandlers的/ webMethods的..看到這個http://stackoverflow.com/questions/579024/calling-an-ascx-page-method-使用-jquery – 2012-02-22 04:48:48
那麼我怎麼能發送文件到處理程序? – Rocky 2012-02-22 04:54:37