473,396 Members | 1,804 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,396 software developers and data experts.

Dynamic two-way data binding

AM
The following block of code defines a FormView control "FormView1" with
an EditItemTemplate which has a Label and a TextBox control within it.

While the Label "RequestIDLabel1" has one-way data-binding to the
underlying column "RequestID", the TextBox "RequestDateTextBox" has
two-way data-binding to the underlying column.

If I were to generate the EditItemTemplate dynamically at runtime, and
add the Label and TextBox controls at run-time, how can I establish the
two-way data-binding between the "RequestDateTextBox" and the
"RequestDate" column?

Any help will be appreciated. Thanks.

<asp:FormView ID="FormView1" runat="server"
DataKeyNames="RequestID" DataSourceID="SqlDataSource1">
<EditItemTemplate>
RequestID:
<asp:Label ID="RequestIDLabel1" runat="server"
Text='<%# Eval("RequestID") %>'></asp:Label><br />
RequestDate:
<asp:TextBox ID="RequestDateTextBox" runat="server"
Text='<%# Bind("RequestDate") %>'>
</asp:TextBox><br />
</EditItemTemplate>
</asp:FormView>

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:DEMO70ConnectionString %>"
SelectCommand="SELECT [RequestID], [RequestDate], [RequestDesc],
[PeopleAffected] FROM [SR]"
OldValuesParameterFormatString="original_{0}">
</asp:SqlDataSource>

Apr 21 '06 #1
0 1468

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

Similar topics

2
by: Richard | last post by:
Hi all, I had a stored procedure that i wanted to be able to pass parameters to so i used dynamic SQL. I am getting very strange errors though when i try to execute it. My code works just fine,...
11
by: fivelitermustang | last post by:
Actually, how would I go about allocating a four-dimensional dynamic array? I only know how to make two dimensional dynamic arrays: double **v; v = new double*; for (int i=0; i<C; i++) { v =...
12
by: CJM | last post by:
How can I dynamically sort the results from a Stored Procedure? Or more importantly, what is the fastest and most efficient way? I know I can do the sorting within the recordset in ASP, but AFAIK...
7
by: Abraham Luna | last post by:
how do i stop the dynamic validators from breaking explorer if i use a dynamic validator and move to a different control it breaks explorer and i can type in the page when i'm not supposed to....
2
by: dawg1998 | last post by:
I have a page that creates dynamic textboxes based on the number of fields a user chooses to fill out. This process worked great when the page was standalone. However, when I move to a...
0
by: Erland Sommarskog | last post by:
My article on dynamic SQL, "The Curse and Blessings of Dynamic SQL" is frequently referred to in these newsgroups. I like to announce that I have rewritten this article thoroughly. I started off...
0
by: Tony Hedge | last post by:
Okay I'm back with another issue ;-) Platform is .NET, VB 2005... I created a templace class that I was successfully able to add as a template column to a GridView control - dynamically!!! So...
3
by: lovecreatesbea... | last post by:
Do the following two functions use dynamic two-dimension array correctly? #include <stdio.h> #include <stdlib.h> #define ROW 3 #define COL 5 int dyn2dary(void);
1
by: Suleman | last post by:
Write a Program in some language that has both static and stack-dynamic local variables in subprogrms. Create six large (at least 100*100 ) matrices in the subprogram,three static and three stack...
1
by: ict027 | last post by:
i wanted to create a two dimensional dynamic array in vs.net . but it gives errors, this is the syntax i tried; Dim arrDen(,) As Integer(numOfEmp, nDen) i hope your suggestions to create...
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:
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
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...
0
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,...

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.