Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 5th, 2007, 04:31 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default How to: Restrict access to paged data

Could have put it all in the title if space allowed!!

but anyway, looking for a generic way to only allow logged in users' to page all content that's pageable. anonymous users would be able to see initial results page (be that articles, posts or search results) and indicators of how many pages of paged data exist (i.e. it would all look normal enough until the 2nd page [2] was clicked) something to the effect that 'this page is only viewable to subscribers, to enjoy the benefits...bla bla etc..'

an example of what i'm after can be found here:

http://www.code-magazine.com/Article...uickid=0703041

as i said, i could 'hack' it in code per page, but was wondering if there were a 'clever' authentication method to do this on a generic/specified level.

cheers




jimi

http://www.jamestollan.com
__________________
jimi

http://www.originaltalent.com
 
Old April 5th, 2007, 05:50 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

achhh - i was just being dense. it'll have to be captured in the PageIndexChanging event... as in:

        protected void gvwThreads_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            if (!this.User.Identity.IsAuthenticated)
            {
                this.RequestLogin();
                gvwThreads.PageIndex = gvwThreads.PageIndex;
            }
            else
            {
                gvwThreads.PageIndex = e.NewPageIndex;
            }
        }

somehow the simple things slip your mind at times!!

jimi

http://www.jamestollan.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
How I can restrict desktop user to access some res anjanmaity General .NET 1 June 27th, 2008 01:40 PM
Tomcat - Restrict Directory access pradheepayyanar BOOK: Professional Apache Tomcat 0 October 27th, 2006 06:03 AM
multi paged multiple checkboxes with same name pro kcs_chandra Classic ASP Basics 1 October 23rd, 2004 03:45 AM
Login user & restrict access lucian Dreamweaver (all versions) 5 September 7th, 2003 12:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.