473,667 Members | 2,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic two-way data binding

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

While the Label "RequestIDLabel 1" has one-way data-binding to the
underlying column "RequestID" , the TextBox "RequestDateTex tBox" has
two-way data-binding to the underlying column.

If I were to generate the EditItemTemplat e dynamically at runtime, and
add the Label and TextBox controls at run-time, how can I establish the
two-way data-binding between the "RequestDateTex tBox" and the
"RequestDat e" column?

Any help will be appreciated. Thanks.

<asp:FormView ID="FormView1" runat="server"
DataKeyNames="R equestID" DataSourceID="S qlDataSource1">
<EditItemTempla te>
RequestID:
<asp:Label ID="RequestIDLa bel1" runat="server"
Text='<%# Eval("RequestID ") %>'></asp:Label><br />
RequestDate:
<asp:TextBox ID="RequestDate TextBox" runat="server"
Text='<%# Bind("RequestDa te") %>'>
</asp:TextBox><br />
</EditItemTemplat e>
</asp:FormView>

<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:DEMO70Connec tionString %>"
SelectCommand=" SELECT [RequestID], [RequestDate], [RequestDesc],
[PeopleAffected] FROM [SR]"
OldValuesParame terFormatString ="original_{0}" >
</asp:SqlDataSour ce>

Apr 21 '06 #1
0 1485

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

Similar topics

2
1465
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, but when i add the dynamic sql parts in, it gives the strangest errors. Here is the code that executes it... Declare @data_source varchar(50)
11
5210
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 = new double; }
12
5657
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 this is not the most efficient method. Ideally, I'd like to pass a parameter to the SP to indicate sorting field order... How do you guys go about this?
7
1884
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. thank you.
2
7681
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 Content/MasterPage setup, the MasterPage Form seems to be interfering with the ability of my code to retrieve the value in the dynamic control. Are there any ideas on why this is happening or how to work-around the problem? What is the syntax to find a...
0
1029
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 with revising it for SQL 2005, but the more I looked at it, I felt that it was time for a major overhaul. After all, I wrote the initial version with a mindset of SQL 6.5. The URL is the same: http://www.sommarskog.se/dynamic_sql.html. At the...
0
1533
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 my GridView has two 'hard-wired' columns plus any number of dynamic columns. And the template class has a checkbox control in it.
3
1531
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
2958
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 dynamic. Fill two of the static matrices and two of the stack-dynamic matrices with random numbers in the range of 1 to 100.The code in the subprogram must perform a large no. of matrix multiplication operations on the static matrices and time the...
1
1645
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 two dimensional dynamic array in vs.net. thanks
0
8888
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
8790
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
8650
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
7391
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
6206
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
5677
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
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2779
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
2
2017
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.