Click here to Skip to main content
15,903,523 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear All

I want to open a window dialog for selection of file on client PC using asp.net without using server control file brows..

I m Also Use this Code

protected void btntft_Click(object sender, EventArgs e)
{
String Location = String.Empty;
OpenFileDialog frm = new OpenFileDialog();
frm.Filter = "";
frm.Title = "Browse Config file";
//frm.InitialDirectory = "D:\\";
DialogResult ret = STAShowDialog(frm);


}
private DialogResult STAShowDialog(FileDialog dialog)
{
DialogState state = new DialogState();
state.dialog = dialog;
System.Threading.Thread t = new System.Threading.Thread(state.ThreadProcShowDialog);
t.SetApartmentState(System.Threading.ApartmentState.STA);
t.Start();
t.Join();
return state.result;
}
public class DialogState
{

public DialogResult result;
public FileDialog dialog;
public void ThreadProcShowDialog()
{
result = dialog.ShowDialog();
}
}

But Its Not being work on IIS Server

Please help how can I call
Thanks
Posted
Updated 25-Apr-14 21:25pm
v2

1 solution

You can't: only the user can do that, by selecting an upload control.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900