473,320 Members | 2,158 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,320 software developers and data experts.

How to add databinding expression for a server control programatically

I have a Composite Server Control.
It has Templates.
When the Itemplate InstantiateIn runs I add a label and a TextBox very similar to a datagrid Template.

Now during design time I want the HTML to show
<ITemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.A") %>'></asp:Label>
<asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.A") %>'> </asp:TextBox>
</ItemTemplate
---------------------------

I set the text property in InstateIn accordingly.

But the HTML display becomes

<asp:Label runat=&quot;server&quot; Text="'<%# DataBinder.Eval(Container, &quot;DataItem.A&quot;) %>'>
</asp:Label>

<asp:TextBox runat=&quot;server&quot; Text='<%# DataBinder.Eval(Container, &quot;DataItem.A&quot;) %>'>
</asp:TextBox>
----------------------------
All the double quotes become &quot; and the value is wrapped by double quotes. I want to add the data binding expression without distortion
----------------------

How do I achieve this?
Oct 23 '09 #1
0 1325

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John | last post by:
Hi, heres a brief description of what I'm trying to do. I have a sql table named colors that looks like this: color_id color_name 1 blue 2 red 3......... and so...
1
by: | last post by:
Hi, I posted a message a while ago about programatically databinding and got a response that did not make sense to me. Here's a brief description of what I want to do. If I create a regular...
6
by: Nathan Sokalski | last post by:
I am using a DataSet as the DataSource of a DataList in my code. The SQL used to get the data from the database begins with: SELECT...
8
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
1
by: CorporateCoder | last post by:
Hi, I am trying to bind the selected value of a databound dropdown box in a databound gridview control to the value being displayed in the template column the dropdown box has been added to. ...
1
by: Owen Blacker | last post by:
I've spent loads of time Googling to try to work this one out and I'm sure it's something obvious. I get an InvalidOperationException reading "Databinding methods such as Eval(), XPath(), and...
1
by: Alan Samet | last post by:
I know what's causing this, but how do I work around it? ********************** file: test.master: ********************** <%@ Master %> <script runat=server> void Page_Load(object sender,...
7
by: rodchar | last post by:
hey all, for simplicity's sake i have a single textbox inside a user control. once i drag that user control onto my page is there a way to attach a binding expression to it at runtime? thanks,...
1
by: Mundo | last post by:
Hi I'm pulling my hair out with a problem caused when DataBinding a DataSet to a web control. I first tried using a GridView but when that failed, I tried a Repeater. I'm getting the classic...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.