473,770 Members | 7,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem: <%= %> is not evaluated..

I created a user control with two public properties and drop it to an aspx
page as the following

<uc1:myUserCont rol
id="myUserContr ol1"
runat="server"
MyProperty1="<% = this.MyVar1 %>"
MyProperty2="<% = this.MyVar2 %>" >
</uc1:myUserContr ol>

Why the "<%= this.MyVar1 %>" and "<%= this.MyVar2 %>" are not evaluated and
returned as raw string instead?
Thanks
Nov 18 '05 #1
3 1511
ruskie, add a pound and see if it works. Make sure you call the databind
method on your user control on a parent control.

<%# %>
"ruskie" <ru****@noreply .com> wrote in message
news:eg******** ******@TK2MSFTN GP11.phx.gbl...
I created a user control with two public properties and drop it to an aspx
page as the following

<uc1:myUserCont rol
id="myUserContr ol1"
runat="server"
MyProperty1="<% = this.MyVar1 %>"
MyProperty2="<% = this.MyVar2 %>" >
</uc1:myUserContr ol>

Why the "<%= this.MyVar1 %>" and "<%= this.MyVar2 %>" are not evaluated
and
returned as raw string instead?
Thanks

Nov 18 '05 #2
Ruskie,

The server side directives will not evaluate unless you call the
databind method on the user control. Did you do that?

sayed

"ruskie" <ru****@noreply .com> wrote in message news:<eg******* *******@TK2MSFT NGP11.phx.gbl>. ..
I created a user control with two public properties and drop it to an aspx
page as the following

<uc1:myUserCont rol
id="myUserContr ol1"
runat="server"
MyProperty1="<% = this.MyVar1 %>"
MyProperty2="<% = this.MyVar2 %>" >
</uc1:myUserContr ol>

Why the "<%= this.MyVar1 %>" and "<%= this.MyVar2 %>" are not evaluated and
returned as raw string instead?
Thanks

Nov 18 '05 #3
I added a pound sign then call Page.DataBind in the parent page. And it
works, thanks for all suggestion. My problem solved.
"ruskie" <ru****@noreply .com> wrote in message
news:eg******** ******@TK2MSFTN GP11.phx.gbl...
I created a user control with two public properties and drop it to an aspx
page as the following

<uc1:myUserCont rol
id="myUserContr ol1"
runat="server"
MyProperty1="<% = this.MyVar1 %>"
MyProperty2="<% = this.MyVar2 %>" >
</uc1:myUserContr ol>

Why the "<%= this.MyVar1 %>" and "<%= this.MyVar2 %>" are not evaluated
and
returned as raw string instead?
Thanks

Nov 18 '05 #4

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

Similar topics

6
5873
by: Pete Mahoney | last post by:
I am trying to 'POST' values from a form in a ASP file that has anonymous access permissions. I can retrieve the form values when I redirect to this page from another page which has also has anonymous access permissions. However, if I change the page from which I'm redirecting to use NT authentication, then I cannot retrieve the values of the form fields using POST method. Specifically, if the following file (MyStart.asp) has anonymous
1
6827
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
6
2408
by: Bonge Boo! | last post by:
This has got to be obvious, but I can't make it work. I have a form called with 3 pull down menus. They are linked to a database which generates the values for the <SELECT? Pull-downs. Lets say I have values selected for all three pull down menus. When I change the first "top-level" menu I want to reset both the second and third menus to the "default" state.
0
1110
by: hugo batista | last post by:
Hi everybody I'm having a problem with the following environment: - Windows 2003 web edition - .net framework 1.1 I created a dummy web services that accepts a string in a webmethod. With some strings, the web server does not respond at port 80. If i configure my web app to respond on another port, there is no problem, but using port 80,
4
1566
by: Neil Zanella | last post by:
Hello, I would like to know what the difference is among the constructs <%= %> for evaluating an expression and displaying the evaluated result on the page and <%# %>. In particular I would like to know why the <%# %> construct is necessary in locations where the other <%= %> does not do. It seems to me that there is no equivalent of the <%# %> construct in PHP, thus I thought I would post to clarify. Is this an ASP.NET specific...
1
10737
by: Rebecca Tsukalas | last post by:
Hello, I have a problem concerning removeChild. This is the XML structure I use with php: <xml_thing <language1 <site>bla1</site <site>bla2</site <site>bla3</site </language1
6
4091
by: comp.lang.php | last post by:
I am trying to pipe in some auto-generated PHP into php.exe, to no avail: catch {exec echo '<? if (@is_file("./functions.inc.php")) { require_once("./functions.inc.php"); echo xml_to_tcl_list("&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;&lt;fortune&gt;&lt;saying id=&quot;1&quot; author=&quot;Phil Powell&quot; phrase=&quot;New York is SO Superior!&quot;&gt;&lt;/saying&gt;&lt;saying id=&quot;2&quot; author=&quot;Phil Powell&quot;...
3
8621
by: farukcse | last post by:
Dear Sir, i am facing a problem with encoding for arabic characters. here is the code: 1.test.html &lt;html&gt; &lt;body&gt; &lt;script type="text/javascript"&gt; var AJAX = { initialize: function(){
2
2074
by: zek2005 | last post by:
Hi! I have a value loaded in a database as following: &lt;p&gt;&lt;strong&gt;test&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;test 2&lt;/ strong&gt;&lt;em&gt;&lt;strong&gt;questions&lt;img alt=&quot;&quot; src=&quot;http://www.mysite.com/fckeditor/editor/images/smiley/msn/ regular_smile.gif&quot; /&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
1
2086
by: prasath03 | last post by:
Hi, I am struggling with the following problem. Can somebody pls help me?. I am developing a wesbite for user can edit their files only, so i am going to develop a page for a Tree Structure in jsp. I got one java code from internet, that working perfectly in java, it doesn't work after i converted in jsp. I don't know what is the problem in that code. If anybody knows the answer let me know.... When i run that code from jsp it throws the...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10230
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10058
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9870
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8886
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6678
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.