Html.Lookup load home/index contain instead of lookup page content

Jul 31, 2011 at 8:50 AM

Hi ,

I facing one problem. I have set up my global.asax.cs as below in RegisterRoutes

routes.MapRoute("Agent", "{userName}", new { controller = "Home", action = "Agent" });

The reason i doing above i to get quick link (eg: www.[domainname].com/KWEK)

when i try to click Html.Lookup , it manages to pop up but the lookup page load the content of www.[domainname].com instead lookup content for (Country/city)

When i remove  red highlighted above, it works fine.

Is there any setting i have to set in html.lookup so that the page manage to load lookup page content or other alternative??

Thanks if you could help me on this problem..




Jul 31, 2011 at 3:19 PM

use firebug, and look in the console to where the requests go to 

Jul 31, 2011 at 3:57 PM
Edited Jul 31, 2011 at 4:10 PM

i found out it the request go to this path http://localhost:1692/CityIdLookup?prop=CityId&paging=false&multi=false.

Then straight to  http://localhost:1692/ instead of go to POST http://localhost:1692/CityIdLookup/Search

routes.MapRoute("Agent", "{userName}", new { controller = "Home", action = "Agent" });

Green highlisted above treated as username for http://localhost:1692/{username }

Is there any way to set Html.Lookup go to http://localhost:1692/CityIdLookup/Search???

Many Thanks.

Jul 31, 2011 at 8:05 PM
Edited Jul 31, 2011 at 8:10 PM

try experimenting with the routing (probably ordering of the MapRoute), atm there's no way you can specify the path 

it goes to CityIdLookup/index and index is the default so it's not written

Aug 1, 2011 at 3:20 PM

I did try experimenting the routing. But i not success to do it. At the same time I have to preserve www.[domainname].com/{username}.
Hope you can give me some clue on it or way to solve the problem i had. Thanks.. : ) 

Aug 1, 2011 at 3:26 PM

try using areas, and put the awesome stuff inside an area

Aug 1, 2011 at 3:42 PM
Edited Aug 1, 2011 at 4:11 PM

Do you have the example awesome for using areas? It be would great for me to understand better.:) Thanks..

Aug 1, 2011 at 4:45 PM

yes, in the live demo

Aug 3, 2011 at 4:01 AM

Thank you. Great...It works fine now..;)