<li> |
<asp:Label ID="lbSurname" runat="server" Text="Surname: " AssociatedControlID="lstSurname"> </asp:Label> |
<telerik:RadComboBox ID="lstSurname" runat="server" ReadOnly="true" DataTextField="Family" |
DataValueField="Family" AppendDataBoundItems="True" AllowCustomText="True" MarkFirstMatch="True" |
OnSelectedIndexChanged="lstSurname_SelectedIndexChanged" AutoPostBack="True" CausesValidation="False"> |
</telerik:RadComboBox> |
<asp:RequiredFieldValidator ID="RFV_lstSurname" runat="server" ValidationGroup="Personal" |
ControlToValidate="lstSurname" ErrorMessage="Please enter Surname">*</asp:RequiredFieldValidator> |
</li> |
<li> |
<asp:Label ID="lbFname" runat="server" Text="First Name: " AssociatedControlID="lstFirst"> </asp:Label> |
<telerik:RadComboBox ID="lstFirst" runat="server" ReadOnly="true" DataTextField="First" |
DataValueField="First" AppendDataBoundItems="True" AllowCustomText="True" MarkFirstMatch="True" |
AutoPostBack="True" CausesValidation="False" |
onselectedindexchanged="lstFirst_SelectedIndexChanged"> |
</telerik:RadComboBox> |
<asp:RequiredFieldValidator ID="RFV_lstFirst" runat="server" ValidationGroup="Personal" |
ControlToValidate="lstFirst" ErrorMessage="Please enter First Name">*</asp:RequiredFieldValidator> |
</li> |
<li><asp:Label ID="lbJobTitle" runat="server" Text="Job Title:" |
AssociatedControlID="txtJob"></asp:Label> |
<telerik:RadTextBox ID="txtJob" runat="server" MaxLength="150" Width="200px"></telerik:RadTextBox> |
/li> |
protected void lstFirst_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) |
{ |
string First = lstFirst.SelectedItem.Text; |
string family = lstSurname.SelectedItem.Text; |
var query = from x in dc.tblEmp |
where x.First.ToLower() == First.ToLower() && x.Family.ToLower() == family.ToLower() |
orderby x.Family |
select new |
{ |
Job = x.Job_Title |
}; |
************txtJob.Text = query; ************ |
} |
How do I bind data to Textbox?
I am selecting Surname and Firstname to fire query to get Job Title. I only want to display in textbox .
Can anyone help me find solution?
Thanks in advance
Sucheta