Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 28th, 2008, 10:45 AM
Registered User
Join Date: Mar 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default controlling asp:xml DocuementSource=

Please bare with me and my noobness.
Platform: Visual Web Developer 2008 Express
Page type: aspx (not using code behind)

I am building a site that displays data from a mssql datasource. As the user drills down to the detail levels they have the option to click a link to view an xml based report.

I am able to staticly point the xml control to an xml file, but what I really need to do is use a path supplied by the sql database and add the virtual directory to create the complete link.

I know how to pass the querystring data once the user clicks the datagrid link on the previous page. Is there a way to utilize this to build the path I need to display the correct xml?

I have been looking for a fix for over a week. It seems that I should be able to use the passed data in the XML control's DocumentSource= area.

This works right now. It is a static DocumentSource path.

<asp:Xml ID="Xml1" runat="server"

^^portion of the link in bold can be passed from the previous page.

What do I put in DocumentSource= to make it use the "ResultsLink" field from the prior page?
Old April 3rd, 2008, 10:36 AM
Registered User
Join Date: Mar 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts


I can now pass the entire xml file path as a string from the previous page. I just need to get the ASP:XML DocumentSource= to use the string. But, the control doesn't accept <% %> fields.

Can I build this programicly?
Old April 14th, 2008, 07:21 AM
Registered User
Join Date: Mar 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

found the fix. i knew it was easy. special thanks to sachin_07 on asp.net forum.



My code looks like this...

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.Xml1.DocumentSource = Server.MapPath(Request.Item("link"))
    End Sub

Similar Threads
Thread Thread Starter Forum Replies Last Post
Controlling Alt+Ctrl+Del Keys through Asp.Net 2005 p330418 ASP.NET 2.0 Basics 5 February 13th, 2008 01:18 PM
xml invalid top level from ASP write XML(solution) g000we XML 0 August 9th, 2006 03:56 AM
Controlling Outgoing Custom XML Envelope Content RaminS Biztalk 1 June 12th, 2003 06:03 AM
XML, XML Schema, JavaScript, ASP cyberjames2003 XML 0 June 4th, 2003 04:49 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.