473,387 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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

<uc1:myUserControl
id="myUserControl1"
runat="server"
MyProperty1="<%= this.MyVar1 %>"
MyProperty2="<%= this.MyVar2 %>" >
</uc1:myUserControl>

Why the "<%= this.MyVar1 %>" and "<%= this.MyVar2 %>" are not evaluated and
returned as raw string instead?
Thanks
Nov 18 '05 #1
3 1486
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**************@TK2MSFTNGP11.phx.gbl...
I created a user control with two public properties and drop it to an aspx
page as the following

<uc1:myUserControl
id="myUserControl1"
runat="server"
MyProperty1="<%= this.MyVar1 %>"
MyProperty2="<%= this.MyVar2 %>" >
</uc1:myUserControl>

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**************@TK2MSFTNGP11.phx.gbl>...
I created a user control with two public properties and drop it to an aspx
page as the following

<uc1:myUserControl
id="myUserControl1"
runat="server"
MyProperty1="<%= this.MyVar1 %>"
MyProperty2="<%= this.MyVar2 %>" >
</uc1:myUserControl>

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**************@TK2MSFTNGP11.phx.gbl...
I created a user control with two public properties and drop it to an aspx
page as the following

<uc1:myUserControl
id="myUserControl1"
runat="server"
MyProperty1="<%= this.MyVar1 %>"
MyProperty2="<%= this.MyVar2 %>" >
</uc1:myUserControl>

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
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...
1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
6
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...
0
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...
4
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...
1
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
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...
3
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:...
2
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;...
1
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...

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.