Click here to Skip to main content
15,879,326 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Problem with Enum and dropdownlist Pin
Peace ON9-May-10 20:48
Peace ON9-May-10 20:48 
QuestionSetting Hyperlinks in order for users to carry out forced downloads Pin
AndyASPVB7-May-10 23:05
AndyASPVB7-May-10 23:05 
Hi
I am using Microsoft's MVC design pattern and I have a method in my controller, which sets the data source of a gridview. Whilst I can bind all the other values in the gridview, I am stuck setting 4 hyperlinks. The hyperlinks need to work in the explanation given in the link below: http://forums.asp.net/p/542979/3077895.aspx for forcing downloads to keep the location of where files are saved to private, which I want set in the controller.

To fully explain what I am doing, in my controller for the gridview, I am setting the gridview's data source using ICollection, which is an object containing results from a query. From this collection, I extract a value which has the name of a folder which contains a number files. So, what I have done is to cast my collection to a object, to get folder name and then use a foreach loop to get each folder name. Then to get the files inside each folder, I use Directory.GetFiles, which returns a string array - I wrote string[] files = Directory.GetFiles(ConfigurationManager.appsettings["filepath"]+folderName); . I have set 4 properties for each Hyperlink I want to set.

It is at this point where I am stuck, because even though I can get to the files, I am unable to set the Hyperlinks to these files. Each time I try an set the NavigateUrl property, I get the error message Object not set to an instance of an object. Plus, I have two other issues to resolve:

1) Even though there are 4 hyperlinks, not every hyperlink will be set. In other words, if there are only two files in the folder, I only want to set the appropriate hyperlinks. So, how can I iterate through the string array, and get each value inside the array to do a check?

2) When I set my Hyperlinks in my controller, how do I simply pass the file and keep the file's actual storage location hidden as given in the link http://forums.asp.net/p/542979/3077895.aspx

Thanks
AnswerRe: Setting Hyperlinks in order for users to carry out forced downloads Pin
Not Active8-May-10 3:25
mentorNot Active8-May-10 3:25 
Questionfile upload control giving error cannot convert the type implicit Pin
developerit7-May-10 19:54
developerit7-May-10 19:54 
AnswerRe: file upload control giving error cannot convert the type implicit Pin
Peace ON7-May-10 21:10
Peace ON7-May-10 21:10 
Questionusing dropdownlist control in update panel control but no selectedindexchange event is firing Pin
developerit7-May-10 19:06
developerit7-May-10 19:06 
AnswerRe: using dropdownlist control in update panel control but no selectedindexchange event is firing Pin
Peace ON7-May-10 21:15
Peace ON7-May-10 21:15 
GeneralRe: using dropdownlist control in update panel control but no selectedindexchange event is firing Pin
developerit8-May-10 0:55
developerit8-May-10 0:55 
AnswerRe: using dropdownlist control in update panel control but no selectedindexchange event is firing Pin
Tej Aj7-May-10 22:03
Tej Aj7-May-10 22:03 
AnswerRe: using dropdownlist control in update panel control but no selectedindexchange event is firing Pin
HardikSitapara10-May-10 19:25
HardikSitapara10-May-10 19:25 
Questionredirection problem Pin
acont7-May-10 12:40
acont7-May-10 12:40 
AnswerRe: redirection problem Pin
Abhijit Jana7-May-10 14:26
professionalAbhijit Jana7-May-10 14:26 
GeneralRe: redirection problem Pin
acont8-May-10 1:50
acont8-May-10 1:50 
AnswerRe: redirection problem Pin
Peace ON7-May-10 21:16
Peace ON7-May-10 21:16 
AnswerRe: redirection problem Pin
HardikSitapara9-May-10 23:58
HardikSitapara9-May-10 23:58 
GeneralRe: redirection problem Pin
acont11-May-10 8:27
acont11-May-10 8:27 
QuestionHave file uploading in background while continuing Navigation Pin
Neil Wilson7-May-10 6:16
Neil Wilson7-May-10 6:16 
AnswerRe: Have file uploading in background while continuing Navigation Pin
Not Active7-May-10 7:09
mentorNot Active7-May-10 7:09 
GeneralRe: Have file uploading in background while continuing Navigation Pin
Neil Wilson7-May-10 11:14
Neil Wilson7-May-10 11:14 
GeneralRe: Have file uploading in background while continuing Navigation Pin
Not Active7-May-10 13:02
mentorNot Active7-May-10 13:02 
AnswerRe: Have file uploading in background while continuing Navigation Pin
Peace ON7-May-10 21:18
Peace ON7-May-10 21:18 
AnswerRe: Have file uploading in background while continuing Navigation Pin
AlexeiXX38-May-10 18:40
AlexeiXX38-May-10 18:40 
QuestionPassing values from ASP to ASP.NET Pin
Ekjon7-May-10 5:46
Ekjon7-May-10 5:46 
AnswerRe: Passing values from ASP to ASP.NET Pin
T M Gray7-May-10 6:08
T M Gray7-May-10 6:08 
GeneralRe: Passing values from ASP to ASP.NET Pin
Ekjon7-May-10 6:18
Ekjon7-May-10 6:18 

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.