I am new to this stuff so I may be the issue. I have a master page and content page. On the master page I have a combobox.
I know there is data being return because i tried hard coding the selected value.
<telerik:RadComboBox ID="cbBox" runat="server" AutoPostBack="True" Height="120px" ErrorMessage="No Items Available" Sort="Ascending"> </telerik:RadComboBox>
Fill by code behind(c#):
using (WorkFlowEntities items = new WorkFlowEntities()) { { this.cbBox.DataSource = from c in items.vw_UserAuth where c.DomainName== "me" select new { c.Name, c.Item }; this.cbProject.DataTextField = "Name"; this.cbProject.DataValueField = "Item"; this.cbProject.DataBind(); this.cbProject.Items.Insert(0, new RadComboBoxItem("Select a item", string.Empty)); } }
All of this works fine. I am trying to access the combobox from a content page but it always returns "" not null though. I am using this code to get the values:
private string getSelectedProject() { RadComboBox masterCombo = (RadComboBox)Master.FindControl("cbBox"); if (masterCombo != null) { return masterCombo.SelectedValue.ToString(); } else { return null; } }I know there is data being return because i tried hard coding the selected value.