.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

How to bind 2 binds, within one control

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :ASP.Net
 

Hi

I currently have two label controls with two bindings:

<asp:Label ID="Label_CompetitionDate" runat="server" Text='<%# Bind("Competition_DateFrom", "{0:d-MMM-yy}") %>' />&nbsp;&nbsp;:&nbsp; 
                                    <asp:Label ID="Label_CompetitionType" runat="server" Text='<%# Bind("CompetitionType_Value") %>' />

<asp:Label ID="Label_CompetitionDate" runat="server" Text='<%# Bind("Competition_DateFrom", "{0:d-MMM-yy}") %>' />
<asp:Label ID="Label_CompetitionType" runat="server" Text='<%# Bind("CompetitionType_Value") %>' />

What I'd like to do is bind the two values using one label. The reason being, I'd like to use this data in a HyperLink control and would like one link, not two, to the same content.

Many thanks
Richard


View Complete Post


More Related Resource Links

Access and Bind data wihtout using Datasource Control

  

i want to bind my gridview with a dataset with concept of caching (to minimize the database server trips). plz give me a best example to get and bind data to gridview (command line) . grid paging is also enabled so example code should be capable to rebind data at Gridview page change.  


How to bind a calendar control to a datasource

  
In my application, user will enter some meeting dates in one page.   In the details page, they need to see those dates to make a selection for one file number. I want to show a calendar in the details page whice will show the dates already entered. To do that I need to bind the calendar to a datasource to get the information from the database. Please guide me to do that. Thanks in advance,

How to Bind a child control with properties of the parent control in Silverlight and WPF?

  
Dear Experts, I have a usercontrol in Silverlight and I want to enable the update button inside the usercontrol with property defined in the usercontrol. For the proof of concept sake I have defined the usercontrol xaml and the code behind in VB.NETBelow is the XAML and VB.NET Code. ----------------------------------------------------------------------- <UserControl x:Class="SLBAppAssementQuestions.SilverlightControl1"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"     mc:Ignorable="d"     d:DesignHeight="300" d:DesignWidth="400">     <StackPanel>         <CheckBox x:Name="chkBox1" Margin="10" Checked="chkBox1_Checked" >Checkbox1</CheckBox>         <CheckBox x:Name="chkBox2" Margin="10" Checked="chkBox2_Checked">Checkbox1</CheckBox>         <Button  x:Name="BtnUpdate&q

I need a suggestion to bind the data in share point 2010 page.Suggest some right control to do this.

  
In my visual web part i need a control to display rows with grouping option. In my web part i am going to display all my document library and  announcement so that i need groping option. I need to do grouping option in the view.so what is the best control u suggest me to bind my data? 

Is it best to use Eval or Bind in a databound control?

  
I have a repeater I've databound with a generic arraylist from a LINQ query (.ToList() )  in the code behind.  I was using   <%# Bind("FirstName")%> but noticed  <%# Eval("FirstName")%> works just as well.    Is it better to use Eval or Bind?  or does it depend on the situation?        

Bind control to results from thread

  
Hello,  I can't find best practice to my issue, I will appreciate any help from you – Please let me know what you think about it:  My application request data by threads. Each thread have those events: OnStarting – Fires just before the thread start its job. OnFound – Can be fire more than one for each thread. The result from thread can be received here OnFinish - Fires just after the job finish.  The scenario is something like that: Let's say I have WinForm contains RadioButton for "Search Type" and Button for "Start Search". The user choose the search type and press on "Start Search". According the search type the form knows to place new control like Grid or TextBox on the form. The result from thread (The thread do the searching job) should display in the appropriate control which opened for this specific search.  My question: What is the best practice to bind control to the result from thread ?   Options: 1.     Save Key=Value list for Thread=Control 2.     Create MyGrid / MyTextBox with even OnFill. The application will use OnFill as callback in the threads. 3.     Any other suggestion will be very welcome.   Thanks in advance !

Bind Data to a Calender Control

  
I have a data on my Standby _ Table look like this in database   ID EMP_NO YEAR MONTH DAY 3 10001 2010 09 17 4 10002 2010 09 18 5 10002 2010 09 19   Now I want have this data displayed in a form of a Calendar , actually a full page calendar. My senario is I have employees doing standby weekly but I want to have their standby dates displayed in a form of a calendar , can somebody please help me even if it means I have to change the table structure.   Im using a VS2008 .NET 3.5 Regards,      

MVVM: How to bind a page in a tab control with a viewmodel?

  
We practise MVVM pattern.
We have a main window which contains tab controls. Each tabItem contains a page.
Since the main window needs to share some data with one of page, so our MainWindowViewModel creates the instance a RunconditionViewModel.
Then we need to set the instance of RunconditionViewModel to one of page's DataContent (page called ControlPage.xaml).
How do we achieve that? see the code below.

In HDMainWindow.xaml,
<TabControl x:Name="tabControlMain" DockPanel.Dock="Left" MinHeight="200"  SelectedIndex="0" TabStripPlacement="Left" >
<TabItem Header="Run" Name="TabItemControlPage"> <Frame Name="FrameControlPage" Source="Features\Basic Control\ControlPage.xaml"></Frame> <!--<Frame Source="Features\Basic Control\LoginPage.xaml"></Frame>--> </TabItem> in App.xaml.cs,

protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); InitializeComponent(); HDMainWindow hd = new HDMainWindow(); HDMainWindowViewModel hwd = new HDMainWindowViewModel(); hd.DataContext = hwd; //if (hd.TabItemControlPage != null) // hd.TabItemControlPage.DataContext = hwd.RunConditionsViewModel; if (hd.FrameControl

How to bind GroupBy Values in Nested Repater Control

  

In a dataset i m getting values like this


IdApplication    ApplicationDesc    Permissions

1                       User                      Add

1                       User                      Delete

1                       User                      Update

2                       Role                       Add

2                      Role&n

Bind a user control to another control

  

I Have a usercontrol that has a label, the content property of the label I would like to be bound from a slider in the MainWindow class, would this be done by a delegate and event or is there a binding I can apply to it in XAML?

TIA Mike

 


Unable to drag data source to control to bind

  

I have a simple test application following the directions from http://msdn.microsoft.com/en-us/library/dd465159.aspx .  When I attempt to drag the data source onto the design surface I get the following error:

Cannot add the control to the design surface or bind to the control because the type TestApp.AdventureWorksEntities cannot be resolved.  Please try to build the project or add necessary assembly references.

The project as been built and the data source is in the same namespace.  I did a search for this error and the only hit I found was here, and mentioned Tools->Options->Extension Manager, 'Load per use extensions...'.  This option is checked.  I've tried unchecking and restarted with the same behavior.

Any ideas?

 


how to bind panel control to datatable

  

i have panel & i m trying to bind it with data table

as panel has no datasource property. can anyone solve it out.

DataTable dt=new DataTable ();

DataRow dr = dt.NewRow();
            dr["serviceid"] = ddlservices.SelectedValue.ToString();
            dt.Rows.Add(dr);
            foreach (DataRow row in dt.Rows)
            {
                PanelBody.Controls.Add(row);
                PanelBody.DataBind();
            }

thanks in advance



How can I bind a XMLDataSource to a Label control in code Behind?

  

How can I bind a XMLDataSource to a Label control in code Behind?

I have added a XMLDataSource pointing to my XML file and filtered the data by XPath. Then I bind it to a Form View. I use <%# XPath("tag") %> in .aspx file to show the data in form view. My requirement is to access some of the tags that are not displayed/used in .aspx page but need to be used in code behind. I don't know how to bind XMLDataSource to a label control in the code behind file. Please help.


How can I bind a XMLDataSource to a Label control in code Behind?

  

How can I bind a XMLDataSource to a Label control in code Behind?

I have added a XMLDataSource pointing to my XML file and filtered the data by XPath. Then I bind it to a Form View. I use <%# XPath("tag") %> in .aspx file to show the data in form view. My requirement is to access some of the tags that are not displayed/used in .aspx page but need to be used in code behind. I don't know how to bind XMLDataSource to a label control in the code behind file. Please help.


Bind Repeater Control with JSON object

  

I have dropdown in the aspx page. I am calling JQuery on dropdown chnage and JQuery is calling GenericHandler.ashx . The Handler is retuns 

Serialize JSON  string. I ned to bind  my Repeater control with this JOSN object any can have idea . could you please help fro me. here I am giving  my sample aspx page code

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>

<script type="text/javascript"  src="Shared/jquery-1.4.2.js" ></script>
<script type="text/javascript">
$(document).ready(function(){
  $("#ddlPaging").change(function(){
    var _entityId = 1;
    var _rowCount  = 5;
  var _pageIndex  = 8;
 
 

adding static text before Bind() in datalist control

  

Hello, I have a datalist control

In it, I have a hyperlink that im binding the url, and the text to from a mysql database

here is my code so far

<asp:HyperLink ID="HyperLink1" runat="server"
    NavigateUrl='<%#Bind("topicid") %>' Text='<%# Bind("title") %>'></asp:HyperLink>


Now, the problem is, the field "topicid" returns a number, such as 3. I want to add the following text before it: viewTopic.aspx?id=

So, ideally, i want something like this

<asp:HyperLink ID="HyperLink1" runat="server"
    NavigateUrl='<%# "viewTopic.aspx?id=" + Bind("topicid") %>' Text='<%# Bind("title") %>'></asp:HyperLink>

But, when I do it that way, I obviously get an error.

So, is there any way to solve this problem without having to modify the database?

Thank You


JQuery to bind ASP:Repeater control

  

I need to bind a ASP:repeater control by Jquery method which would call a server behind method I've been able to call Server side method which return string but If i have to return a List what do i need to do.




Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend