如何将Master与Detail联系起来? [英] How to link Master to Detail?

查看:83
本文介绍了如何将Master与Detail联系起来?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个rss解析器。


well i am trying to create an rss parser.

            XDocument doc = XDocument.Load("http://newsrss.bbc.co.uk/rss/newsonline_world_edition/europe/rss.xml");
            var read = from c in doc.Descendants("item")
                       select new 
                       {
                           title = c.Element("title").Value, description= c.Element("description").Value
                       };


            DropDownList1.DataSource = read;
            DropDownList1.DataTextField = "title";
            this.DataBind();


我面临的问题是我无法以任何方式链接"标题"。对于描述?

例如当表单加载下拉列表时会填充标题。
用户选择一个标题,它应该显示相关的"描述"。在标签中。

任何帮助PLZ?

The problem i face  is i can not link in any way the "title" to discription?

For example  when the form load the dropdownlist get populated with titles.
User select a title and it should show a related "discription" in a label.

Any help plz?

推荐答案

您好,我建议您尝试以下添加链接工具提示下拉列表, http://www.cnblogs.com/jaic-xiao/ archive / 2008/09/27 / DropDownList_tooltip.html 您需要做的是再次迭代doc项,以填写所有下拉列表项的工具提示,如下所示:

Hello,
I suggest you try following links of adding tooltip to dropdownlist, http://www.cnblogs.com/jaic-xiao/archive/2008/09/27/DropDownList_tooltip.html
what you need to do is to iterate the items of doc again, to fill out the tooltip for all dropdownlist items like following:

for(int i = 0; i< DropDownList1.Rows.Count; i ++)
{

for (int i = 0; i < DropDownList1.Rows.Count; i++)
{

//现在让我们遍历DropDown控件添加"标题"到结果HTML"< option>" elements:这会将toolip添加到突出显示的元素
为(int i2 = 0; i2< dropDownList.Items.Count; i2 ++)
{46. DropDownList1.Items [i2] .Attributes。添加(" Title",DropDownList1.Items [i2] .Text);
}



委托
haowei

    //Now let's iterate through the DropDown controls to add a "Title" to the
    //resulting HTML "<option>" elements: this will add the toolip to highlighted element
    for (int i2 = 0; i2 < dropDownList.Items.Count; i2++)
    {
        DropDownList1.Items[i2].Attributes.Add("Title", DropDownList1.Items[i2].Text);
    }
}

Regards
haowei


这篇关于如何将Master与Detail联系起来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆