<%#Eval("XXX")%> into a var
<%#Eval("XXX")%> into a var
<%#Eval("XXX")%> into a var
<%#Eval("XXX")%> into a var
<%#Eval("XXX")%> into a var
<%#Eval("XXX")%> into a var <%#Eval("XXX")%> into a var <%#Eval("XXX")%> into a var <%#Eval("XXX")%> into a var <%#Eval("XXX")%> into a var <%#Eval("XXX")%> into a var <%#Eval("XXX")%> into a var <%#Eval("XXX")%> into a var
<%#Eval("XXX")%> into a var <%#Eval("XXX")%> into a var
<%#Eval("XXX")%> into a var
Go Back  Xtreme Visual Basic Talk > > > <%#Eval("XXX")%> into a var


Reply
 
Thread Tools Display Modes
  #1  
Old 07-30-2007, 08:48 AM
DIABLO's Avatar
DIABLO DIABLO is offline
Regular
 
Join Date: Dec 2003
Location: Portugal
Posts: 70
Unhappy <%#Eval("XXX")%> into a var


How can i get the response of <%#Eval("smtg")%> , into a dim var?

<%# dim x = Eval("smtg")%> does not work
<% dim x = Eval("smtg")%> does not work either (there is no # in this 1)

=(
Reply With Quote
  #2  
Old 07-30-2007, 09:47 AM
MKoslof's Avatar
MKoslof&lt;%#Eval(&quot;XXX&quot;)%&gt; into a var MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

You could handle this in your page_load event or any server side event as normal. You could write the sub in your HTML markup or just use the default code behind.

Code:
  Dim val as string = Eval("string expression").ToString();
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
  #3  
Old 08-01-2007, 07:36 AM
DIABLO's Avatar
DIABLO DIABLO is offline
Regular
 
Join Date: Dec 2003
Location: Portugal
Posts: 70
Default

I get the same error. Ill try to tanslate to English, because its in portuguese.

"Métodos de ligação de dados como Eval(), XPath() e Bind() só podem ser utilizados no contexto de um controlo ligado a dados. "

in English:

"The methodes of the data connection like Eval, Xpath and Bind can only be used in a context of a data connected control"

I am using the "Dim val as string = Eval("foto").ToString()" inside a DataList wich is connected to a XmlDataSource...

Code:
<asp:DataList ID="DataList1" runat="server" DataSourceID="XmlDataSource1">
	<ItemTemplate>
		<div>
		<%
		Dim val as string = Eval("foto").ToString()
		response.write(val)
		%><br />
		</div>
(...)
Reply With Quote
  #4  
Old 08-11-2007, 04:54 PM
MKoslof's Avatar
MKoslof&lt;%#Eval(&quot;XXX&quot;)%&gt; into a var MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

Sorry, been away from the forum...is this problem still an issue?

OK, under this circumstance I might take a different approach. Could you store this value in the viewstate of the current page?
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
&lt;%#Eval(&quot;XXX&quot;)%&gt; into a var
&lt;%#Eval(&quot;XXX&quot;)%&gt; into a var
&lt;%#Eval(&quot;XXX&quot;)%&gt; into a var &lt;%#Eval(&quot;XXX&quot;)%&gt; into a var
&lt;%#Eval(&quot;XXX&quot;)%&gt; into a var
&lt;%#Eval(&quot;XXX&quot;)%&gt; into a var
&lt;%#Eval(&quot;XXX&quot;)%&gt; into a var &lt;%#Eval(&quot;XXX&quot;)%&gt; into a var &lt;%#Eval(&quot;XXX&quot;)%&gt; into a var &lt;%#Eval(&quot;XXX&quot;)%&gt; into a var &lt;%#Eval(&quot;XXX&quot;)%&gt; into a var &lt;%#Eval(&quot;XXX&quot;)%&gt; into a var &lt;%#Eval(&quot;XXX&quot;)%&gt; into a var
&lt;%#Eval(&quot;XXX&quot;)%&gt; into a var
&lt;%#Eval(&quot;XXX&quot;)%&gt; into a var
 
&lt;%#Eval(&quot;XXX&quot;)%&gt; into a var
&lt;%#Eval(&quot;XXX&quot;)%&gt; into a var
 
-->