473,508 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XmlDataSource, datafile to a variable

hi, i am trying to put a session variable in the DataFile of the
XmlDataSource, but for some reason i am getting: Server tags cannot
contain <% ... %constructs.

<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="<%
Session("UserPath") %"></asp:XmlDataSource>

I have even tried this:

<asp:XmlDataSource ID="XmlDataSource1" runat="server"
DataFile="<%=Session("UserPath") %"></asp:XmlDataSource>

any idea ?

Aug 23 '06 #1
2 2670
server tags can only contain binding expressions, which is interpreted at
runtime. try:

<asp:XmlDataSource ID="XmlDataSource1"
runat="server"
DataFile="<%#Session("UserPath") %>" />

be sure to call the bind method.

-- bruce (sqlwork.com)
"Zulander" <zu******@gmail.comwrote in message
news:11*********************@p79g2000cwp.googlegro ups.com...
hi, i am trying to put a session variable in the DataFile of the
XmlDataSource, but for some reason i am getting: Server tags cannot
contain <% ... %constructs.

<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="<%
Session("UserPath") %"></asp:XmlDataSource>

I have even tried this:

<asp:XmlDataSource ID="XmlDataSource1" runat="server"
DataFile="<%=Session("UserPath") %"></asp:XmlDataSource>

any idea ?

Aug 24 '06 #2
One obvious things is the quoting

<asp:XmlDataSource ID="XmlDataSource1" runat="server"
DataFile="<%=Session("UserPath") %">
</asp:XmlDataSource>

should be

<asp:XmlDataSource ID="XmlDataSource1" runat="server"
DataFile='<%=Session("UserPath") %'>
</asp:XmlDataSource>

(notice the single quotes for the datafile), although this gives you
"The server tag is not well formed" errors,

Kevin Jones

Zulander wrote:
hi, i am trying to put a session variable in the DataFile of the
XmlDataSource, but for some reason i am getting: Server tags cannot
contain <% ... %constructs.

<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="<%
Session("UserPath") %"></asp:XmlDataSource>

I have even tried this:

<asp:XmlDataSource ID="XmlDataSource1" runat="server"
DataFile="<%=Session("UserPath") %"></asp:XmlDataSource>

any idea ?
Aug 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1966
by: John Jumper | last post by:
I am using an XmlDataSource in VS2005Beta1 and setting the TransformFile property in my ASCX and it is finding both files. However, the resulting data does not contain any of the sub nodes of the...
2
3150
by: mike | last post by:
can somebody please show me some code that will let me populate a checkboxlist from the xmldatasource, and have the text property set to the names in the xml file thanks you can also email me...
0
1221
by: mike | last post by:
<Lookup> <Lookup_Entry> <Ts> <T> <M>context</M> <V>type</V> <Va>Citizen</Va> </T> </Ts> <U>.html</U>
3
9155
by: Brian | last post by:
Using external XML, I'm trying to build a quiz, but I can't seem to specify the DataSource for the RadioButtonList within a Repeater ItemTemplate. I've tried a number of approaches, but I haven't...
0
1348
by: Jon Davis | last post by:
My repeater is not repeating any items. I am trying to use an XmlDataSource to load a custom .sitemap file having content similar to as follows: <siteMap> <siteMapNode title="Home"...
1
3163
by: Disccooker | last post by:
i am trying to use XPath and the XMLDataSource to display data from an XMLDocument and am getting nowhere. What i would like to do is have a repeater display a label for Seed, label for Team Name...
2
1824
by: rote | last post by:
I have a code below i'm trying to test It had a DataSetDatasource but i thinks its deprecated if yes what can i use in this scenario below? I used XmlDatasource but its saying it can't find the...
0
1750
by: pompair | last post by:
Hello, I'm making a quiz game for fun. I have an xml file like this: <?xml version="1.0" encoding="utf-8" ?> <results> <index>99</index> <answers>11</answers> <questions> <question id="1">
1
1788
by: Sean | last post by:
I am experiencing a strange problem using the XMLDataSource and DataList controls which I cannot seem to resolve. I am using the controls to read and display a variety of RSS feeds. On my local...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7066
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.