How to create a site with pagination with the same URL? - pagination

I'm trying to create a page with articles on it, on the bottom of the page I want pagination to continue the articles on different pages (but the same URL). So for example, 5 articles are showing on one page, and you have to click "2" or "next" to get to the next 5 articles and so on. When the user clicks "2" or "next", I want the URL to stay the same but have ?pg=2 at the end of it.
Maybe I'm overthinking this but I can't find a solution to this.
Any help would be great!

The approach is ok.
When a user clicks on the 'next page' button, you redirect to <url>?p=<next page number>. The server would use the session parameter p to serve the objects for the requested page.
Pagination should be done on the backend, you don't want to send all pages to the client at once.

Related

Limit Printing of Web Page

I'm in the beginning phases of developing a website. I want to be able to limit the amount of printing of web pages of circulars. These will be in an image format and usually consist of between 2 and 16 web pages. The circulars change each week.
Is there a way to limit the user to only 1 or X number of prints for each page and for each week? Is this easier done with standard web development or can it be done even easier in a content management system such as WordPress?
Not unless you have full control over the client-side.
You can TRY to prevent that SAME computer (via cookie) from
navigating to the same page twice.
If you are giving the user a unique ID to access the circular pages,
you can mark that ID as already having displayed the pages.
But there is simply no way to make sure that the user can't call the print calls in the browser.
One trick, which a js hacker could easily get around.. tie into the page printed event. The answers to that question talk about just how poorly the events are supported, and not cross-browser. If this browser has already had that event fire, nav away or change the #media rule for printing to return css making the whole page display:none (or some trickery).
As far as the actual print dialog ("Copies: x"), there's nothing you can do.

SharePoint Dataform webpart redirection issue

I have two web parts in my sharepoint aspx web page. One is Content editor web part and the other is data form web part.
In data form web part, I have a data view and I need to pass a parameter "id" to this dataview which will show the project details in the data view. I tried to use a value from a control as a parameter and never had a success. I did googled a lot last few days and haven't found any solution. It would be great, if someone show me a way to use the text from a control (may be a text box or select control). if someone have a working sample, please share. Alternatively I have used a query string as a parameter (eventhough I prefer to use text from a control). We need to pass a query string called id. For example, I am navigating to http://localhost/pages/1.aspx?id=7. This will show the project details of project id 7 in data form web part. this works fine.
I need to provide an option to user to enter the project id instead of modifying the query string in url. To achieve that I used content editor web part and I have a text box text1 and a submit button (html controls). The user will enter project id in the text box provided and will click the submit button to view the project details in dataview. The submit button javascript code has the following code:
url = 'http://localhost/pages/1.aspx?id=7';
alert (url); //alerts as http://localhost/pages/1.aspx?id=7
window.location = url;
For testing purpose, I just hardcoded the url. However, clicking the submit button is not redirecting to http://localhost/pages/1.aspx?id=7 or something happens during redirect. The page just reloads once. i.e., if I am in http://localhost/pages/1.aspx?id=12 and clicking the submit button reloads the page http://localhost/pages/1.aspx?id=12 instead of navigating to http://localhost/pages/1.aspx?id=7.
Without data form web part, the redirect works fine. Kindly help.
Thank you

Redirecting in SharePoint

I am having an issue regarding navigation in my SharePoint site. On my front page I have a link that takes you to the EditForm.aspx of one of my lists. When I edit an element and click save, SharePoint takes me to the list. Instead I want it to take me back to the default page, where I came from.
Is there any way to redirect back to the page I initially came from, instead of going back to the list?
Found the answer! http://www.graphicalwonder.com/?p=666
Use '?source=' in your anchor tag url, that way it will return to the source site, rather than back to the list.
Ex: http://yoursite/yourlist/newform.aspx?source=http://yoursite/yourlibrary/thankyou.aspx
Works perfectly!

Read value from one aspx page to another

i have two pages: 1) web control(ascx page) and 2) web page(aspx page without master page).
Now i calculate some values on page2 through google api through Javascript on render, and i need to transfer these values to page 1 in a hidden field through code. please help
Khushi
One way (of many):
On the Client side: Fill the hidden
field, submit the form (with js)
Code Behind
Page 2: Collect the data in the code
behind, Populate the session,
Response.Redirect to page 1
Another:
Without using the the hidden field, you could
just append the calculation result to
the query string. (/page.aspx?myResult=xy)
Obvious, quick answer: use querystring or Session object.

how to hide querystring in asp.net content page?

i have master-content page scenario.I have a link button on content page. that redirects to other page. but with redirection it carrying the parameters. I want to hide this querystring parameters .I tried with POST() in Form tag of master page . but that does not affecting. What have to do ?
There are many ways to carry values from one page to the next. You could store the values in some Session type container, or add them as hidden fields.
If you want a ugly way, you could use a good old frameset.
POST is the answer, but we'll need some code to help more effectively

Resources