ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Send parameter to SearchForm in MultiLookup
Title:
B
I
{code}
?
I use custom search multilookup, and i need to send parameter to searchform and catch it in controller public ActionResult SearchForm(int orderid){ ... } How i can do it? i need functionality like search(int orderid) function and .Parameter("orderid",Model.OrderId), and i need build filter from SearchForm(int orderid) for this orderid, orderid -select by user from main page, and i don't know this from searchform.cshtm
Save Changes
Cancel
yura
asked at 07 Aug 2015
put hidden input in the search form, or visible (type=text), depends on your needs, it's important for it to have the name attribute <input type='hidden' name='orderid' value='123' /> you set this in the searchform.cshtml, have a look at this demo: http://demo.aspnetawesome.com/LookupDemo/CustomSearch, note the "SearchForm View" tab
at 07 Aug 2015
Omu
Answers
B
I
{code}
?
if you do <input type="text" id="p2" name="p2" value="abc"/> this could be a dropdown, hidden, or anything that has an id and value @Html.Awe().Lookup("Meal").Parameter("p1", 123).Parent("p2", "myparam") then in the controller search action you'll get this: public ActionResult Search(string search, int? p1, string myparam)// p1 = 123, myparam = abc you can see something similar here: http://demo.aspnetawesome.com/LookupDemo/Misc#Lookup-bound-to-many-parents, you can change the value of the dropdown and search result of the ChildMeal will differ _ the CustomSearch(bool) extension is for generating a custom search form inside Popup window of the lookup, when you set it to true you also have to add a SearchForm action in the lookup's controller, and that action will return a view with the custom search form
Save Changes
Cancel
Omu
answered at 07 Aug 2015
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK