473,664 Members | 3,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Label databinding

Hello
I am fairly new to ASP.Net 2.0 and have been having trouble.

I have a form view which displays data from related tables. In the edit and
new template I have some DropDownLists which allow a list of values from
other tables to be selected for update or insertion.

What I want to do is to have the current values displayed in the item
template on a label. I have tried this without success and also tried to put
a formview within the formview without luck.

Can anyone advise how /if this could be done .

Thanks
Jul 26 '06 #1
3 4013
<asp:label id="MyLabel" runat="server" text='<%# Bind("FieldName ") %>'>

"David" wrote:
Hello
I am fairly new to ASP.Net 2.0 and have been having trouble.

I have a form view which displays data from related tables. In the edit and
new template I have some DropDownLists which allow a list of values from
other tables to be selected for update or insertion.

What I want to do is to have the current values displayed in the item
template on a label. I have tried this without success and also tried to put
a formview within the formview without luck.

Can anyone advise how /if this could be done .

Thanks
Jul 26 '06 #2
sorry i meant:

<asp:label id="MyLabel" runat="server" text='<%# Bind("FieldName ") %>'/>

"clickon" wrote:
<asp:label id="MyLabel" runat="server" text='<%# Bind("FieldName ") %>'>

"David" wrote:
Hello
I am fairly new to ASP.Net 2.0 and have been having trouble.

I have a form view which displays data from related tables. In the edit and
new template I have some DropDownLists which allow a list of values from
other tables to be selected for update or insertion.

What I want to do is to have the current values displayed in the item
template on a label. I have tried this without success and also tried to put
a formview within the formview without luck.

Can anyone advise how /if this could be done .

Thanks

Jul 26 '06 #3
Thanks but the problem is that what I want to display is the value from a
related table and this code displays the data from the orginal table. This
displays an id value rather than the value from related table.

"clickon" <cl*****@discus sions.microsoft .comwrote in message
news:68******** *************** ***********@mic rosoft.com...
sorry i meant:

<asp:label id="MyLabel" runat="server" text='<%# Bind("FieldName ") %>'/>

"clickon" wrote:
><asp:label id="MyLabel" runat="server" text='<%# Bind("FieldName ") %>'>

"David" wrote:
Hello
I am fairly new to ASP.Net 2.0 and have been having trouble.

I have a form view which displays data from related tables. In the
edit and
new template I have some DropDownLists which allow a list of values
from
other tables to be selected for update or insertion.

What I want to do is to have the current values displayed in the item
template on a label. I have tried this without success and also tried
to put
a formview within the formview without luck.

Can anyone advise how /if this could be done .

Thanks

Jul 26 '06 #4

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

Similar topics

3
3756
by: GM | last post by:
I am building the text for a resume section label in databinding with 20 or so data columns using a series of 20 or so code snippits like the following: If e.Item.DataItem("EmployerDisplay") And e.Item.DataItem("Employer") <> "" Then Sections.Text += "<BR><B>Employer</B>: " & e.Item.DataItem("Employer") End If Is this an efficient way to build the section label's text property? Any suggestions?
1
1505
by: Martin | last post by:
Hi, I've got a web label control which I set a databind expression on the Text attribute in the html for the page (aspx file). At runtime, I want to override this attribute, so before I do MyLabel.databind() (or actually Page.DataBind()), I set Text to "". This doesn't work because then the databind comes along and redefines the Text attribute.
4
1964
by: Jeronimo Bertran | last post by:
I am currently using databing to show on an asp:label the result of appending two database fields in the following way: <asp:label id=textAcknowledgedBy runat="server" Text='<%# DataBinder.Eval (dataSetEventResponse1, "Tables.DefaultView..UserName") + " from " + DataBinder.Eval(dataSetEventResponse1, "Tables .DefaultView..ComputerName") %>'></asp:label>
3
6632
by: PK9 | last post by:
I'm having some issues with using a Response.Write or the shortcut ( <%= ...) from within a label control. I cannot do this in the code behind, I need to do it here at runtime. I have a public function (GetMsgs) in my code behind page that returns a string back to the caller. I want to call this function from the ASPX page and return the value to a Label control. I have tried the following options but cannot get it to work: 1)...
9
2574
by: jjack100 | last post by:
I want to set the text value of a label that is within a datalist in the codebehind. Does this have to be done in the databound event? Simplified example: <asp:DataList id="dlItem" runat="server"> <ItemTemplate> <asp:Label ID="lblItemPrice" runat="server" /> </ItemTemplate> </asp:DataList>
3
1835
by: Ryan | last post by:
I have a form that contains a field that is a Foreign Key (UserID) I want this control to have a "label" appearance but I want it to act as a lookup table (SelectedValue = FKID, SelectedText = "Joe Blow"). Using a ComboBox control is the only way I've found to do this (and its actually really easy) but I haven't found a way to disable everything and make that combo box just look like a standard label. The label control doesn't seem to...
1
2460
by: SteveT | last post by:
Folks, I am reading/writing data within an XML file. In my form I have a label that is assigned to the UpdateDate field within the XML file. Within the form I update the label to a different date. The code is below. The issue I'm having is that the DataBinding doesn't seem to be behaving correctly. The changed value of my "label" is not being written to the file when AcceptChanges() is called. Instead, the original value from within...
8
1482
by: fiefie.niles | last post by:
I am new to ASP.Net. I use VB.NET as the language and Visual Studio ..NET 2003. On my WebForm I have a label called "Categories". I would like to read all the categories from the database and placed them under the label "Categories". I also would like each category to be a hyperlink to go to another page. How can I do that ? Using the codes below the categories are not placed under the label "Categories", and there is no hyperlink for...
2
3849
by: rn5a | last post by:
Consider the following code: <script runat="server"> Sub ShowData(obj As Object, ea As EventArgs) lblDate.Text = DateTime.Now.ToString("d") lblDate.DataBind() End Sub </script> <form runat="server"> <asp:Label ID="lblDate" OnDataBinding="ShowData" runat="server"/>
0
4332
by: Czechtim | last post by:
Hello, I have problem with databinding. I created small application using structure that I need to demonstrate problem. I need to change content of label when changing content of property "Promena". I change content of property "Promena" from "Origin text" to "Changed text" using thread but content of label is still the same - databinding isn´t working according to my vision. Does somebody know, please, why content of label doesn´t change...
0
8437
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
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
7375
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
6187
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
5660
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
4351
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2764
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
1759
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.