Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 为什么我不能在我的ASCX页面上获取RADComBo框的值_C#_Telerik_Radcombobox - Fatal编程技术网

C# 为什么我不能在我的ASCX页面上获取RADComBo框的值

C# 为什么我不能在我的ASCX页面上获取RADComBo框的值,c#,telerik,radcombobox,C#,Telerik,Radcombobox,我的UserControl(ascx)页面上有一个RADCombo框,其中包含此配置 <telerik:RadComboBox RenderMode="Lightweight" runat="server" ID=CBoxEmail DataTextField="Name" DataValueField="EmailAddress" AutoPostBack="true&

我的UserControl(ascx)页面上有一个RADCombo框,其中包含此配置

<telerik:RadComboBox RenderMode="Lightweight" runat="server" ID=CBoxEmail DataTextField="Name"
               DataValueField="EmailAddress" AutoPostBack="true"
            EmptyMessage="**Enter LastName**" OnItemsRequested="CBoxEmail_ItemsRequested" Height="200px" Width="300"
        ShowMoreResultsBox="true" Text ='<%# DataBinder.Eval(Container, "DataItem.PersonIntendedFor") %>' >
    </telerik:RadComboBox> 

我要求的物品如下:

 protected void CBoxEmail_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        using (ForensicEntities db = new ForensicEntities())
        {
            IQueryable<VW_ActiveUsers_EmailAddress> AllUsers = db.VW_ActiveUsers_EmailAddress.OrderBy(i=> i.Name);

            if (!string.IsNullOrEmpty(e.Text))
            {
                AllUsers = db.VW_ActiveUsers_EmailAddress.Where(i => i.Name.Contains(e.Text.Trim()));

            }

            var employee = AllUsers;//.Skip(e.NumberOfItems).Take(6);
            CBoxEmail.DataSource =
            CBoxEmail.DataSource = employee.Distinct().ToList();
            CBoxEmail.DataBind();

            int endOffset = e.NumberOfItems + employee.Count();
            int totalCount = AllUsers.Count();

            if (endOffset == totalCount)
                e.EndOfItems = true;

            e.Message = String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>",
                endOffset, totalCount);
        }
    }
protected void CBoxEmail_ItemsRequested(对象发送者,Telerik.Web.UI.radcomboboxitemsrequestedventargs e)
{
使用(取证db=新取证())
{
IQueryable alluser=db.VW\u ActiveUsers\u EmailAddress.OrderBy(i=>i.Name);
如果(!string.IsNullOrEmpty(e.Text))
{
AllUsers=db.VW\u ActiveUsers\u EmailAddress.Where(i=>i.Name.Contains(e.Text.Trim());
}
var employee=AllUsers;//.Skip(例如NumberOfItems)。取(6);
CBoxEmail.DataSource=
CBoxEmail.DataSource=employee.Distinct().ToList();
CBoxEmail.DataBind();
int endOffset=e.NumberOfItems+employee.Count();
int totalCount=AllUsers.Count();
if(endOffset==totalCount)
e、 EndOfItems=真;
e、 Message=String.Format({1}中的项目1-{0}),
内偏移、总计数);
}
}
此设置可用于添加新记录。但是,当我试图编辑现有记录时,RADComboBox上SelectedValue的字符串值返回为空字符串