I want to download the file from db which has been save in my application.I downloaded the file . but i want to open it as a pdf file.How to do that..
Here is the code i used to download.
if (e.CommandName == "ResumeDownload")
Cache["filename"] = e.CommandArgument.ToString();
String strRequest = Cache["filename"].ToString();// '-- if something was passed to the file querystring
if (strRequest != "") // 'get absolute path of the file
String path = Server.MapPath("Attachments\\" + strRequest);// 'get file object as FileInfo
FileInfo file = new FileInfo(path);// '-- if the file exists on the server
Response.AddHeader("Content-Disposition", "attachment; filename=\"" + file.Name.ToString()+ "\"");
Response.ContentType = "application/octet-stream";
Response.End();// 'if file does not exist
ClientScript.RegisterStartupScript(typeof(Page), "alert", "<script>alert('File Not Found')</script>");
Response.Write("Please provide a file to download.");
Hi everyone, I am trying to write a web method in my web service which will accept information in a hashtable and process it and again will return hashtable. I am trying to do this in C#. But it is throwing an exception that hashtable can't be serialized b'coz it implements IDictionary. Is there any solution.....
i hav populated the two dropdown lists from database.
according to the item selected in the dropdown i want to change
the respective textbox value.I hav written code it works for first dropdown but not for second.whenever i change the item in dropdownlist2 it does not show any value in its respective textbox.
the code is: