Last post Jan 22, 2008 08:57 PM by roymartian
Jan 21, 2008 06:06 AM|roymartian|LINK
Does anyone know how to change categories to be shown as a drop down menu, my site is getting very cluttered with categories.
If possible would also like to add additional search drop down menus on home page - any ideas?
Really would like front page to have;
Category - drop down menu
Location - drop down menu
Jan 21, 2008 01:00 PM|xcmtb|LINK
Look inside the project for a folder named "controls" and you will find a user control named CategoryDropDown.ascx and another control named LocationDropDown.ascx. Whichever page you wish to use the dropdownlist on, just make a reference to the appropriate
control and use it to suite your needs.
1. Create a new page
2. Add this: <%@ Register TagPrefix="uc2" TagName="CategoryDropDown" src="~/Controls/CategoryDropDown.ascx" %>
3. Then this: <uc2:CategoryDropDown ID="CategoryDropDown" runat="server" AllCategoriesOptionText="Please Select"></uc2:CategoryDropDown>
Load the page and you will have a dropdown filled with your categories. If out of the box the control is not exactly what you're looking for, I'm sure you can edit the existing functionality or create a new user control with the base functionality and then
tweak it for your specific needs.
I hope that helps to get you going.
Jan 22, 2008 06:05 AM|roymartian|LINK
Great help thanks, I can now see the drop down menu's however just placed a test advert on
location: greensborough (preset location, through admin login)
However the ad is not shown as listed, when I try to find another ad;
cateogry: Antiques & Collectibles
location: melbourne (written is dialogue box as other location)
I am taken to the Search.aspx page.
Great help so far any ideas with this problem...
Jan 22, 2008 11:27 AM|darkknight187|LINK
If I understand your question right you need to add a postback url to the dropdown.
Then it will transfer to the search page to display the ad.
Also you will need to carry over the dropdown selections to the search page,
see your code behind on search.aspx.vb
It's already doing it for other carry overs.
Jan 22, 2008 02:52 PM|roymartian|LINK
Yes, although drop down menu's are in place they do not provide any results, (see
Could you please advise on where and what I should modify to add a postback url to the drop down?
Currently just added code previously advised to a fresh installation of classfieds starter kit.
Jan 22, 2008 03:20 PM|darkknight187|LINK
It's pretty easy, and it's already doing it on the search page, like I told you.
First get rid of the autopostback set on your dropdowns, then add a button,
set the buttons postback url to whatever page you are getting your search results on.
Take note of what your two dropdown ids are.
If you look in your Search.aspx.vb page you will see this.
' carry over just search term as regular search in category
Copy the way they already are using the adtype or photos checkbox.
There are several sections you need to mimic to carry over the dropdown.Selected Value.
When in doubt, make a backup, and try anything . . .
Jan 22, 2008 03:31 PM|DigitalRedEye|LINK
When I viewed your homepage I can see that your category id number for Antiques & Collectibles is 1. The search page looks for three different parameters. (id, member and c) The letter "c" tells the page to look for a "category" id being passed to the page. So
basically you just need to take the values out of the dropdownlist on page submit and send it to search.aspx formatted like "/search.aspx?c=1.
So... add an input button on your homepage that will submit the dropdown values to the search page with the URL looking like this: /search.aspx?c=1.
I hope that helps getting you closer to a finished solution.
Jan 22, 2008 07:50 PM|darkknight187|LINK
Hey roy, did you get it???
If you still need help post some of your code, and I'll fix it for you.
I did exactly what you are describing on my home page.
Let me know if you need help.
Jan 22, 2008 08:57 PM|roymartian|LINK
Thanks, been playing with search.aspx, seems to be working now
http://www.jobfunk.com/Search.aspx going to paste code into default tonight and test.
Would also like to remove option for "other location..." so as admin I am only one who can set locations.
Also want to remove default "----All Categories--------" so not all items are listed.
Next big challenge is I want to add another control !!!
So goes something like this for drop downs;
State: VIC, NSW, SA, WA
Location: List of locations for each state
Service: Plumber, Hairdresser etc...
Just not sure how to firstly add another control then secondly make location drop down dependent on state drop down?
Going to continue my ASP.NET for dummies, thanks for great help, is there any more going...