Forum  General Visual ...  How do I...?  HtmlBox and url for href= link
Previous Previous
 
Next Next
New Post 3/17/2010 7:45 AM
Resolved
  nrainer10
50 posts
No Ranking


HtmlBox and url for href= link 

I am trying to create a link in some html to appear in an HtmlBox that, when clicked on, will open a file in a sub-folder of my VWG app.

I don't want the full folder path to appear in the <a href= element as I think this would be too insecure (i.e. I don't want to use Context.Server.MapPath).  However, if I try to make the link relative and just make it <a href="MyFolder/MyFile.txt">, then VWG prefixes the URL with the following:

/Route/1.96.1/ie/en-US/Default/

So the URL becomes /Route/1.96.1/ie/en-US/Default/MyFolder/MyFile.txt.  As this path doesn't exist on the server, the link fails.

What am I doing wrong?

Any help gratefully received.  Thanks

NR

 
New Post 3/17/2010 5:53 PM
Accepted Answer 
  palli
11189 posts
1st Level Poster




Re: HtmlBox and url for href= link 

Hi,

For this purpose you should use a gateway. You set the Url of the HtmlBox to be a reference to your gateway, and then in the ProcessGatewayRequest, you serve the contents of your physical file to the response strem so it will be shown in the HtmlBox. You can find more about Gateways on the Wiki. On that page you will find some examples, an the "...gateway listing folders..." one might be worth looking at for you.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 3/18/2010 10:15 AM
  nrainer10
50 posts
No Ranking


Re: HtmlBox and url for href= link 

Thanks for your help, Palli.

 
New Post 3/18/2010 3:06 PM
  palli
11189 posts
1st Level Poster




Re: HtmlBox and url for href= link 

Hi,

You are welcome. Good luck with your project.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 3/23/2010 11:02 AM
  nrainer10
50 posts
No Ranking


Re: HtmlBox and url for href= link 
Modified By nrainer10  on 3/23/2010 1:26:36 PM)

Sorry to come back on this.

I have replaced the HtmlBox with a panel on which I dynamically create LinkLabel objects.  The LinkLabel objects are created from a list received from a database of file names.  I have also implemented the FileDownloadGateway control as per the wiki and other posts on this forum.

When I click on the LinkLabel for the file, VS2008 breaks at a point in Resources.Gizmox.WebGUI.Forms.Form.js.wgx, where the code says "{window.open(v2,v189,v647)", with an "Access is denied" error.  This appears to be a VS 2008 error message rather than ASP or VWG.  The options are then to Break, Continue or Ignore.  Nothing happens if I click Break or Continue.  If I select Ignore, then after a few further seconds, another error appears saying "htmlfile: Invalid argument".  If I select Ignore again, the file opens in a new tab.Can anybody help, please?

 
Previous Previous
 
Next Next
  Forum  General Visual ...  How do I...?  HtmlBox and url for href= link
Assessment Bottom
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS