Hi everyone,
This is a silly one I'm sure, but I'm having a whale of a time putting some
text into my asp checkbox. Here's what I'd like to do:
<asp:CheckBox runat="server" Text='<%#DataBinder.Eval(Container.DataItem,
"OptionLabel")%> Fields' ID="chkDBFields"/>
....unfortunately, it doesn't work. The DataBinder text is evaluated
literally, so all I get on-screen is the word "Fields". And whenever I try
playing with the quotes I receive various syntax errors. Could someone show
me how to get this to work, so that I have my data-bound field and the word
"Fields" appended to it in the checkbox text? Thanks very much. 3 3591
Hello,
You may want to try:
<asp:CheckBox runat="server" Text='<%#DataBinder.Eval(Container.DataItem,
"OptionLabel") & "Fields" %>' ID="chkDBFields"/>
I have not tried this in a checkbox, but it has worked for me in textboxes.
Regards,
Cesar
"Jim Bancroft" wrote: Hi everyone,
This is a silly one I'm sure, but I'm having a whale of a time putting some text into my asp checkbox. Here's what I'd like to do:
<asp:CheckBox runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "OptionLabel")%> Fields' ID="chkDBFields"/>
....unfortunately, it doesn't work. The DataBinder text is evaluated literally, so all I get on-screen is the word "Fields". And whenever I try playing with the quotes I receive various syntax errors. Could someone show me how to get this to work, so that I have my data-bound field and the word "Fields" appended to it in the checkbox text? Thanks very much.
My experience that it will not work.The reason is that you have ranat
=server attribute.
You should use ItemDataBound event to write the text.
Shimon
"Jim Bancroft" <as******@nowhere.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl... Hi everyone,
This is a silly one I'm sure, but I'm having a whale of a time putting some text into my asp checkbox. Here's what I'd like to do:
<asp:CheckBox runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "OptionLabel")%> Fields' ID="chkDBFields"/>
...unfortunately, it doesn't work. The DataBinder text is evaluated literally, so all I get on-screen is the word "Fields". And whenever I try playing with the quotes I receive various syntax errors. Could someone show me how to get this to work, so that I have my data-bound field and the word "Fields" appended to it in the checkbox text? Thanks very much.
Thank you, Cesar. What I wound up doing was this:
<asp:CheckBox runat="server"
Text=<%#Convert.ToString(DataBinder.Eval(Container .DataItem, "OptionLabel"))
+ " Database Fields"/>
It's what worked for me. I hope someone can make use of it too.
-Jim This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: sklett |
last post by:
I'm curious... asp:Panel renderes a <div> tag, right? And you can have text
in a div tag.... so why not have a Text property for the asp:panel control??
|
by: BARTKO, Zoltan |
last post by:
Hello folks,
I have the following problem:
I have a bunch of text files, I want to load them into a table where each
file will be stored in one row.
Question 1: Is there any way how to do...
|
by: serge calderara |
last post by:
Dear all,
I have a datagrid which is bind to a databse table.
One field of that table contains a filename.
What I ma trying to do is to display the content of a cell to be an icon
when the...
|
by: paul.hester |
last post by:
Hi all,
I'm trying to display the a Page variable's value in the Text property
of a CheckBox control in the aspx file:
<asp:CheckBox ID="agreeTerms" Text="I agree to the <%# this.SiteName %>...
|
by: Kevin Burton |
last post by:
I have an XSD that is converted from a DTD that I am trying to clean up.
There is a section in the XSD that looks like:
<xs:element name="partnerID">
<xs:complexType mixed="true">...
| |
by: Erwin Moller |
last post by:
Hi,
Can anybody comment on this?
In comp.lang.php I advised somebody to skip using:
<script language="javascript">
and use:
<script type="text/javascript">
And mr. Dunlop gave this response:
|
by: K B |
last post by:
Hi,
I would like to show an image in the text position of radiobuttonlist
listitems. Not from a dataset, just set in the html or code behind.
Example (x = radio button)
x Red light image...
|
by: jeddiki |
last post by:
Hi,
I am trying to harmonize my type face with my blog.
this is what I have:
http://www.expert-world.com/im/images/trash3.jpg
Use see the USEFUL CONNECTIONS ?
|
by: bigguyjoe |
last post by:
I am using modx to create a site at www.mmwri.com.
The navigation is dynamically generated by Wayfinder. I am trying to style the text with the navigation div. I can make it look fine in any Mac...
|
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,...
|
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...
| |
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: 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...
|
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,...
|
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...
|
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...
|
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 ...
| |
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...
| |