开发者

asp dialog box?

is there any control in as开发者_Python百科p that allows me to choose a location to save a file.

i have a text box and a button. when a user writes inside the textbox and clicks the button, i want the user to select a folder, and when the user selects one and press ok... i save the text he wrote inside the folder.

in windows form there is the dialog box that allows me to do so... but in asp there is no such control and i tried to add windows forms dll to my web application references but it didn't work when publishing my application on IIS.

is there any similar to dialog box control for asp?


You could generate a text file dynamically and write it to the response thus allowing the user to select a location for saving it. Example:

protected void Button_Click(object sender, EventArgs e)
{
    Response.Clear();
    Response.AppendHeader("Content-Disposition", "attachment; filename=test.txt");
    Response.ContentType = "text/plain";
    Response.Write("some text");
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜