Click here to Skip to main content
15,906,816 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionEval Expression Explanation Pin
ASPnoob15-Sep-12 3:54
ASPnoob15-Sep-12 3:54 
AnswerRe: Eval Expression Explanation Pin
Sandeep Mewara15-Sep-12 7:01
mveSandeep Mewara15-Sep-12 7:01 
GeneralRe: Eval Expression Explanation Pin
ASPnoob15-Sep-12 11:18
ASPnoob15-Sep-12 11:18 
AnswerRe: Eval Expression Explanation Pin
Sandeep Mewara15-Sep-12 19:13
mveSandeep Mewara15-Sep-12 19:13 
QuestionScroll down in the grid view fetches next set of records without freezing the screen Pin
Rohit_daga14-Sep-12 20:47
Rohit_daga14-Sep-12 20:47 
AnswerRe: Scroll down in the grid view fetches next set of records without freezing the screen Pin
Vani Kulkarni14-Sep-12 22:06
professionalVani Kulkarni14-Sep-12 22:06 
AnswerRe: Scroll down in the grid view fetches next set of records without freezing the screen Pin
Alok Sharma ji16-Sep-12 19:04
Alok Sharma ji16-Sep-12 19:04 
QuestionChanging Name of File in File's Path Pin
ASPnoob14-Sep-12 12:59
ASPnoob14-Sep-12 12:59 
Hi all, if I bind my datatable which contains the path of a file or files in a folder on the web server, to a gridview like the following, I will get a gridview with file paths inside of it.

C#
DataTable myTable = new DataTable("myData");

myTable.Columns.Add("URL", typeof(string));

string[] fileEntries = Directory.GetFiles(Server.MapPath("~/Uploads/"));
int linkL = 0;

foreach (string fileName in fileEntries)
{

  myTable.Rows.Add("~/Uploads/" + Path.GetFileName(fileName));
  linkL++;

}

myGrid.DataSource = myTable;
myGrid.DataBind();


As it stands, the code snippet above successfully allows users to download a file by clicking on its path inside of the URL Column of the Gridview. So basically if the file from the web folder is Test.txt I would see the following path in the URL column:
C#
"~/Uploads/Test.txt

But what if I want to change the name Test.txt to a different name and still be able to download the fie? I have tried to change Test.txt to something else by inserting a new name in the path but I get an error message saying that the new file is not found. Any suggestions will be greatly appreciated, thanks for your help.
AnswerRe: Changing Name of File in File's Path Pin
Richard MacCutchan14-Sep-12 23:11
mveRichard MacCutchan14-Sep-12 23:11 
QuestionASP.NET Server Type application in PHP and ASP.NET MVC Pin
Rohit Kesharwani14-Sep-12 9:14
Rohit Kesharwani14-Sep-12 9:14 
QuestionRequest hangs in browser Pin
mrc250314-Sep-12 8:10
mrc250314-Sep-12 8:10 
AnswerRe: Request hangs in browser Pin
Alok Sharma ji16-Sep-12 19:07
Alok Sharma ji16-Sep-12 19:07 
GeneralRe: Request hangs in browser Pin
mrc250317-Sep-12 12:36
mrc250317-Sep-12 12:36 
QuestionCalling WCF Service within another WCF Service throwing eexception Pin
indian14313-Sep-12 14:50
indian14313-Sep-12 14:50 
Questiondebug web form page Pin
dcof13-Sep-12 8:55
dcof13-Sep-12 8:55 
AnswerRe: debug web form page Pin
David Mujica13-Sep-12 9:40
David Mujica13-Sep-12 9:40 
GeneralRe: debug web form page Pin
dcof14-Sep-12 6:57
dcof14-Sep-12 6:57 
QuestionMSChart with multi-datatables Pin
aransiola13-Sep-12 5:47
aransiola13-Sep-12 5:47 
AnswerRe: MSChart with multi-datatables Pin
Sandeep Mewara13-Sep-12 18:26
mveSandeep Mewara13-Sep-12 18:26 
GeneralRe: MSChart with multi-datatables Pin
aransiola24-Sep-12 4:34
aransiola24-Sep-12 4:34 
QuestionHi Pin
cunny13-Sep-12 2:09
cunny13-Sep-12 2:09 
AnswerRe: Hi Pin
Vani Kulkarni13-Sep-12 3:45
professionalVani Kulkarni13-Sep-12 3:45 
AnswerRe: Hi Pin
Abhinav S13-Sep-12 6:17
Abhinav S13-Sep-12 6:17 
Questionasd Pin
Member 878551213-Sep-12 1:32
Member 878551213-Sep-12 1:32 
QuestionTime slot booking application for room in hotel Pin
tarun0019712-Sep-12 23:37
tarun0019712-Sep-12 23:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.