How to open XML file from a ASP Hyperlink control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sri13
    New Member
    • Sep 2010
    • 11

    How to open XML file from a ASP Hyperlink control

    How can I open a XML file from the location mentioned in the web.config file using Hyperlink control?

    I have an aspx page with hyperlink control and in code behind I do the following:

    Code:
    hypLink.Text = "Transformed XML";
    hypLink.NavigateUrl = ConfigurationSettings.AppSettings["OutputXML"];
    web.config looks like:

    Code:
    <add key="OutputXML" value="C:\Working\MyTest\XMLTransform\App_Data\Transformed.xml"/>
    This code is not working. In IE, it doesn't do anything but in FF, it throws a error box with message that the "FF doesn't know how to open this address..."
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Move the Transformed.xml file out of the App_Data folder because you won't be able to access it from the browser there.

    Then specify a valid URL (not a directory path) for the hypLink.Navigat eUrl property.

    -Frinny

    Comment

    • Sri13
      New Member
      • Sep 2010
      • 11

      #3
      Thanks for the response, I will try that.

      Comment

      Working...