My name is charmila and I'm new to Umbraco. I started developing forms. My issue is:
There is a page with multiple select options. The page should navigate to the respective pages based on the conditions. I have applied the condition logic. Show this if * is *.
The problem here is.. If it needs to navigate to the 10th page of the form and skip the 9 pages, it is displaying the blank pages for those 9 pages instead skipping it. My form has so many such options and in some cases need to click next for more than 20 times.
It would be great if someone can help me with this.
I've not fully understood the issue, but can I suggest that you setup you page to use a p querystring to define the page of results e.g.
www.mydomain.com/search?p=10
Then if you want the 10th page of results you would just need to do:
const itemsPerPage = 10;
int pageNo;
pageNo= int.TryParse(Request.QueryString["p"], out pageNo) ? pageNo: 1;
var allResults = WhereYourResultsComeFrom();
var pagedResults = allResults
.Skip((pageNo - 1) * itemsPerPage)
.Take(itemsPerPage);
You'd then return allResults as part of your Model if you're using a controller. If this logic is just in the View then you can just do:
@foreach(var result in pagedResults){
@result.PropertyNameABC //Whatever data you need from your page result
}
It's very tricky to quickly write how/where to put the code if you've no experience of .net. The quick answer is in the template. Have you checked out Umbraco TV? I think you might find that quite helpful. Otherwise you would really be looking to hire a developer to do this for you.
Skip the blank pages on my form
Hi all,
My name is charmila and I'm new to Umbraco. I started developing forms. My issue is:
There is a page with multiple select options. The page should navigate to the respective pages based on the conditions. I have applied the condition logic. Show this if * is *.
The problem here is.. If it needs to navigate to the 10th page of the form and skip the 9 pages, it is displaying the blank pages for those 9 pages instead skipping it. My form has so many such options and in some cases need to click next for more than 20 times.
It would be great if someone can help me with this.
Many thanks in advance.
Hi Charmila,
I've not fully understood the issue, but can I suggest that you setup you page to use a p querystring to define the page of results e.g. www.mydomain.com/search?p=10
Then if you want the 10th page of results you would just need to do:
You'd then return
allResults
as part of your Model if you're using a controller. If this logic is just in the View then you can just do:I hope that is of some use.
Thank you so much for the response.
I'm not sure where to add this code on. I have no knowledge on .net. I'm just trying to develop forms with few fields.
Can you please let me know where can I add the coding part on the tool?
Many thanks
It's very tricky to quickly write how/where to put the code if you've no experience of .net. The quick answer is in the template. Have you checked out Umbraco TV? I think you might find that quite helpful. Otherwise you would really be looking to hire a developer to do this for you.
You might find someone on www.upwork.com
Thank you for the prompt reply. Much appreciated.
I will check the videos on Umbraco TV.
is working on a reply...