473,770 Members | 5,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<%# IsEditable %> and <%= IsEditable %>

Hi,

When I use this tag:

<asp:lable . Visible='<%# IsEditable %>'

I have to do DataBind so the binding takes place.

I am trying to use the following notation to do the similar thing without
forced to call DataBind method:

<asp:lable . Visible='<%= IsEditable %>'

But I receive this error:

Generation of designer file failed: Cannot create an object of type
'System.Boolean ' from its string representation '<%= IsEditable %>' for the
'Visible' property.

Is there any way to use <%= IsEditable %instead of <%# IsEditable % to
avoid calling the DataBind?

Thank you,

Max

Sep 13 '07 #1
7 4676
<%=expression % is executed at render-time, and is meant to output literal
stuff, not to set property values. You certainly could set it in code, but
it removes completely the point of using separate variable.

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

"Max2006" <al*******@news group.nospamwro te in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Hi,

When I use this tag:

<asp:lable . Visible='<%# IsEditable %>'

I have to do DataBind so the binding takes place.

I am trying to use the following notation to do the similar thing without
forced to call DataBind method:

<asp:lable . Visible='<%= IsEditable %>'

But I receive this error:

Generation of designer file failed: Cannot create an object of type
'System.Boolean ' from its string representation '<%= IsEditable %>' for
the 'Visible' property.

Is there any way to use <%= IsEditable %instead of <%# IsEditable % to
avoid calling the DataBind?

Thank you,

Max

Sep 13 '07 #2

Thank you for help.

Do you know any resource that allows me monitor - or spy into - when / how
these bindings happen?

If you know any online resource that explains the depth of the binding in
ASP.NET, that would be really helpful. I like to know binding beyond the
syntaxes.

Thank you,
Max


"Teemu Keiski" <jo****@aspalli ance.comwrote in message
news:uU******** *****@TK2MSFTNG P02.phx.gbl...
<%=expression % is executed at render-time, and is meant to output
literal stuff, not to set property values. You certainly could set it in
code, but it removes completely the point of using separate variable.

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

"Max2006" <al*******@news group.nospamwro te in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
>Hi,

When I use this tag:

<asp:lable . Visible='<%# IsEditable %>'

I have to do DataBind so the binding takes place.

I am trying to use the following notation to do the similar thing without
forced to call DataBind method:

<asp:lable . Visible='<%= IsEditable %>'

But I receive this error:

Generation of designer file failed: Cannot create an object of type
'System.Boolea n' from its string representation '<%= IsEditable %>' for
the 'Visible' property.

Is there any way to use <%= IsEditable %instead of <%# IsEditable %>
to avoid calling the DataBind?

Thank you,

Max


Sep 13 '07 #3
Now that we are discussing about expressions, something like that could in
fact help you: http://msdn2.microsoft.com/en-us/library/d5bd1tad.aspx

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

"Max2006" <al*******@news group.nospamwro te in message
news:OK******** ******@TK2MSFTN GP04.phx.gbl...
>
Thank you for help.

Do you know any resource that allows me monitor - or spy into - when / how
these bindings happen?

If you know any online resource that explains the depth of the binding in
ASP.NET, that would be really helpful. I like to know binding beyond the
syntaxes.

Thank you,
Max


"Teemu Keiski" <jo****@aspalli ance.comwrote in message
news:uU******** *****@TK2MSFTNG P02.phx.gbl...
><%=expressio n% is executed at render-time, and is meant to output
literal stuff, not to set property values. You certainly could set it in
code, but it removes completely the point of using separate variable.

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

"Max2006" <al*******@news group.nospamwro te in message
news:%2******* *********@TK2MS FTNGP05.phx.gbl ...
>>Hi,

When I use this tag:

<asp:lable . Visible='<%# IsEditable %>'

I have to do DataBind so the binding takes place.

I am trying to use the following notation to do the similar thing
without forced to call DataBind method:

<asp:lable . Visible='<%= IsEditable %>'

But I receive this error:

Generation of designer file failed: Cannot create an object of type
'System.Boole an' from its string representation '<%= IsEditable %>' for
the 'Visible' property.

Is there any way to use <%= IsEditable %instead of <%# IsEditable %>
to avoid calling the DataBind?

Thank you,

Max



Sep 13 '07 #4
no.

<%= expression %is translated to:

Controls.Add(ne w Label(expressio n));

where <asp:label id=lb1 Visible=<%=expr ession%/is translated to:

lb1 = new Label();
lb1.Visible = "<%=expression% >";

and when databind is called, it checks for properties with binding
expressions, evals the expression, and sets the property to the value.

-- bruce (sqlwork.com)

Max2006 wrote:
Hi,

When I use this tag:

<asp:lable . Visible='<%# IsEditable %>'

I have to do DataBind so the binding takes place.

I am trying to use the following notation to do the similar thing without
forced to call DataBind method:

<asp:lable . Visible='<%= IsEditable %>'

But I receive this error:

Generation of designer file failed: Cannot create an object of type
'System.Boolean ' from its string representation '<%= IsEditable %>' for the
'Visible' property.

Is there any way to use <%= IsEditable %instead of <%# IsEditable % to
avoid calling the DataBind?

Thank you,

Max
Sep 13 '07 #5
Hi Max,

A tip on inspecting the generated class from a WebForm is to first
precompile the website and use Reflector
(http://www.aisto.com/roeder/dotnet/) to view the source code of the
WebForm:

aspnet_compiler -v / -p c:\projects\web site1 c:\temp\website 1
reflector c:\temp\website 1\bin\*.dll
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 14 '07 #6
Thanks Bruce for reply.

At this point, the outcome of <asp:label id=lb1 Visible=<%=expr ession%/>
is the error I mentioned. It doesn't work!

"bruce barker" <no****@nospam. comwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
no.

<%= expression %is translated to:

Controls.Add(ne w Label(expressio n));

where <asp:label id=lb1 Visible=<%=expr ession%/is translated to:

lb1 = new Label();
lb1.Visible = "<%=expression% >";

and when databind is called, it checks for properties with binding
expressions, evals the expression, and sets the property to the value.

-- bruce (sqlwork.com)

Max2006 wrote:
>Hi,

When I use this tag:

<asp:lable . Visible='<%# IsEditable %>'

I have to do DataBind so the binding takes place.

I am trying to use the following notation to do the similar thing without
forced to call DataBind method:

<asp:lable . Visible='<%= IsEditable %>'

But I receive this error:

Generation of designer file failed: Cannot create an object of type
'System.Boolea n' from its string representation '<%= IsEditable %>' for
the 'Visible' property.

Is there any way to use <%= IsEditable %instead of <%# IsEditable %>
to avoid calling the DataBind?

Thank you,

Max

Sep 14 '07 #7
Hi Max,

lbl1.Visible = "<%= expression %>";

is not a data binding expression, that's why it doesn't work.
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 17 '07 #8

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

Similar topics

9
2961
by: Francesco Moi | last post by:
Hello. I'm trying to build a RSS feed for my website. It starts: ----------------//--------------------- <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd"> <rss version="0.91"> ----------------//----------------------
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
2
3231
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are writing one object in C# which will take the entire table tag contents and renders. Ie., we need to pass "<table>………… <thead>……</thead>. <tr>.<td> <td>..<tr>.<td> <td> </table>" content to
2
10568
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script type="text/javascript"> <!]> </script> <script type="text/javascript"
0
2065
by: Arne Schirmacher | last post by:
I want to display a MySQL database field that can contain HTML markup. If I use <esql:get-string> then I get all of the database field, but all tags are escaped which is not what I want. If I use <esql:get-xml> the tags are not escaped, but only the first part of the database field is displayed. The content of the database field is: "<h1>Title</h1><h2>Subtitle</h2>"
4
62111
by: higabe | last post by:
Three questions 1) I have a string function that works perfectly but according to W3C.org web site is syntactically flawed because it contains the characters </ in sequence. So how am I supposed to write this function? String.replace(/</g,'&lt;');
34
11077
by: Mark Moore | last post by:
It looks like there's a pretty serious CSS bug in IE6 (v6.0.2800.1106). The HTML below is validated STRICT HTML 4.01 and renders as I would expect in Opera, FrontPage, and Netscape. For some reason, there's an annoying vertical gap between adjacent rules that doesn't go away. This looks like IE6 is incorrectly setting the margin to some arbitrary value. Does anyone know if this is a known bug at MS? If you know of one, post the...
11
13725
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom, there's an "Edit" link. So the page itself looks something like this: <HTML><HEAD><TITLE>blah</TITLE></HEAD><BODY> <!-- TEXT STARTS HERE --> <H1>Hello World!</H1> <P>More stuff here...</P>
6
24360
by: tentstitcher | last post by:
Hi all: I have a source xml document with an element of type string. This element contains something like the following: <stringData> &lt;Header&gt; &lt;Body&gt; </stringData> I would like to apply an XSLT and replace all occurances of &lt; with < and &gt; with >.
0
10231
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
10059
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
9871
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
8887
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
6679
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
5452
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
3
2817
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.