|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problems adding HyperLink controls through code.files and create HyperLink controls to add to a PlaceHolder control. The HyperLinks get created accordingly but when clicked, they do nothing. List<string> dirs = FileHelper.GetFilesRecursive(newsLettersPath); foreach (string p in dirs) { HyperLink hlNewsLetter = new HyperLink(); hlNewsLetter.ID = p; hlNewsLetter.Text = p + "<br>"; hlNewsLetter.Target = "_new"; hlNewsLetter.NavigateUrl = p; placeHolder_NewsLetters.Controls.Add(hlNewsLetter); } any help is appreciated. thank folks... - fd "mete hanap" <mete.ha***@gmail.com> wrote in message When the page has been created, do a View Source - what do the individual news:6241ebe1-364a-4461-9e96-015808c2e617@m3g2000pri.googlegroups.com... > Any help is appreciated. href tags of the hyperlink markups look like...? I'm guessing they look something like href="C:\\\\MyServer\\MyFolder\\MyFile.pdf"
Show quote
Hide quote
On Jul 5, 3:28 am, "Mark Rae [MVP]" <m...@markNOSPAMrae.net> wrote: yes mark, that's exactly what they look like. embedded within an <a>> "mete hanap" <mete.ha***@gmail.com> wrote in message > > news:6241ebe1-364a-4461-9e96-015808c2e617@m3g2000pri.googlegroups.com... > > > Any help is appreciated. > > When the page has been created, do a View Source - what do the individual > href tags of the hyperlink markups look like...? > > I'm guessing they look something like > href="C:\\\\MyServer\\MyFolder\\MyFile.pdf" > > -- > Mark Rae > ASP.NET MVPhttp://www.markrae.net tag. what am i missing? thanks.... "forest demon" <mete.ha***@gmail.com> wrote in message Hyperlinks must be resolvable relative or absolute addresses. In the example news:7239f7eb-0aa7-45aa-a482-2b57031eda0d@x6g2000prc.googlegroups.com... >> When the page has been created, do a View Source - what do the individual >> href tags of the hyperlink markups look like...? >> >> I'm guessing they look something like >> href="C:\\\\MyServer\\MyFolder\\MyFile.pdf" > > Yes Mark, that's exactly what they look like. embedded within an <a> > tag. > > What am I missing? above, you have told the web browser to try to load PDF documents on the local C:\ drive. Apart from the fact that these files don't exist on the C:\ drive of the computer on which the web browser is running (they're on the C:\ drive of the web server), security restrictions in all modern browsers would disallow access to local resources like this anyway... You have two choices: 1) ensure that these documents are available to the client browsers are resolvable URLs 2) open the documents on the server as binary files and stream them to the client browser that way 1) above is by far the simplest - simply copy the files into the same virtual directory as the web application and reference them as if they were an aspx page
Show quote
Hide quote
On Jul 7, 6:53 pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.net> wrote: thanks mark. i figured out what i was doing wrong. it had more> "forest demon" <mete.ha***@gmail.com> wrote in message > > news:7239f7eb-0aa7-45aa-a482-2b57031eda0d@x6g2000prc.googlegroups.com... > > >> When the page has been created, do a View Source - what do the individual > >> href tags of the hyperlink markups look like...? > > >> I'm guessing they look something like > >> href="C:\\\\MyServer\\MyFolder\\MyFile.pdf" > > > Yes Mark, that's exactly what they look like. embedded within an <a> > > tag. > > > What am I missing? > > Hyperlinks must be resolvable relative or absolute addresses. In the example > above, you have told the web browser to try to load PDF documents on the > local C:\ drive. Apart from the fact that these files don't exist on the C:\ > drive of the computer on which the web browser is running (they're on the > C:\ drive of the web server), security restrictions in all modern browsers > would disallow access to local resources like this anyway... > > You have two choices: > > 1) ensure that these documents are available to the client browsers are > resolvable URLs > > 2) open the documents on the server as binary files and stream them to the > client browser that way > > 1) above is by far the simplest - simply copy the files into the same > virtual directory as the web application and reference them as if they were > an aspx page > > -- > Mark Rae > ASP.NET MVPhttp://www.markrae.net to do with the way i was doing my recursion and what was being output. i appreciate your time...
Other interesting topics
Brwoser and screen width?
xhtmlConformance mode="Strict" Entity Framework - Reassigning child entity's parent Accessing GridViewRow.DataItem outside of GridView databinding events Need Sr DOT NET Developer | Seatle,Washington | 2+ years Gridview binding twice Dynamic generation of a table Deleting table row in table grid using ASP.NET MVC double click reaches to inline code CSS menu |
|||||||||||||||||||||||