用户单击首页上的类别后,如何在第二页上显示搜索结果? [英] How do I show search results on a second page after user clicked category on first page?

查看:107
本文介绍了用户单击首页上的类别后,如何在第二页上显示搜索结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我是Web开发和LINQ的新手,请问有人可以帮我吗?

我有一个带有两个下拉列表的搜索页面.第一个下拉列表包含类别",第二个下拉列表包含公司名称".下拉列表已经分别绑定到类别表和公司名称表的数据绑定(LINQ). (显示页面时,下拉列表中会填充来自sql数据库的正确数据).我想在第二个下拉列表的所选类别(从第一个下拉列表)中显示CompanyName.当用户选择CompanyName时,我想在DataList的SearchResults页面上显示CompanyDetails.

Hi Everyone

I''m fairly new to web development and LINQ... Can anyone please help me with the following?

I have a search page with two dropdownlists. First dropdownlist contains Categories, second dropdownlist contains CompanyName. Dropdownlists are already databound(LINQ) to Categories Table and CompanyName Table respectively. (The dropdownlists are filled with the correct data from sql database when page is displayed). I would like to display the CompanyName in the selected Category(from first dropdown) in the second dropdown. When user selects CompanyName, I want to display the CompanyDetails on the SearchResults page in a DataList.:confused:

Thanking you in advance.

推荐答案

当用户选择第一个下拉列表时,即在选定的索引更改事件中,第一个下拉列表中填写第二个下拉列表,并添加公司名称您可以使用第一个下拉列表的DataValueField填充第二个下拉列表.当用户选择公司名称时,将公司ID作为查询字符串传递到第二页,并使用该查询字符串填充第二页的数据列表.
When user selects the first drop down ie, in the selected index changed event of first drop down fill the second drop down with the company names.You can use DataValueField of first dropdown to fill the second dropdown.When the user selects the company name, pass company Id as query string to the second page and use that query string to fill the datalist in the second page.


这篇关于用户单击首页上的类别后,如何在第二页上显示搜索结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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