I have one controller and inside it i have 'ActionResult' which call one of my Umbraco page.
I can access that Action via browser by passing query string like below
"<mysite>/search/searchterms"
It's working fine.
The main issue is that i need to persist the query strign in URL. Right now once the page is load , the query string disappear from browser.. so it is looking like "<mysite>/search/".
I want to keep <searchtermss> as well in URL once page loaded.
My situation is that i have serachbox on my Master page . So once i enter keywords and press Enter, it will call my action/ adn redirct on '/search/' page from SurfaceController using "RedirectToumbracoPage()" method and shows all the result.
So URL like <mystename>/search/
What i want is i need to append that keywords what user has entered into the URL as well. <mysitename>/search/keywords ?
Also if user directly enter <mystename>/serach/keywords then also it needs to execute the request and pull the result.
how to persist URL on browser ?
HI
I am workgn on Umbraco 7.2x
I have one controller and inside it i have 'ActionResult' which call one of my Umbraco page.
I can access that Action via browser by passing query string like below
"<mysite>/search/searchterms"
It's working fine.
The main issue is that i need to persist the query strign in URL. Right now once the page is load , the query string disappear from browser.. so it is looking like "<mysite>/search/".
I want to keep <searchtermss> as well in URL once page loaded.
Can anyone please help me ?
thanks in advance !
rohan
Hi Rohan,
On the form for your search field did you use GET or POST in the method, to get the querystring in to the url you need to use GET.
Here is an example that I use, in the project I am using the ezSeach package https://our.umbraco.org/projects/website-utilities/ezsearch
Hope this helps,
/Dennis
Hi Dennis
thanks for the replay.
My situation is that i have serachbox on my Master page . So once i enter keywords and press Enter, it will call my action/ adn redirct on '/search/' page from SurfaceController using "RedirectToumbracoPage()" method and shows all the result.
So URL like <mystename>/search/
What i want is i need to append that keywords what user has entered into the URL as well. <mysitename>/search/keywords ?
Also if user directly enter <mystename>/serach/keywords then also it needs to execute the request and pull the result.
So how to achieve this in Umbraco with MVC ?
thanks
Hi Rohan,
Perhaps these links can help you to solve how to get the query string into the URL.
https://our.umbraco.org/documentation/Reference/Mvc/child-actions
http://stackoverflow.com/questions/21133332/how-to-add-a-query-string-from-surface-controller-in-umbraco-mvc-in-order-to-per
Hope this helps,
/Dennis
is working on a reply...