C# .NET - page sharing - Asked By Indu P on 18-Jan-10 06:47 AM

there is a web application with multiple user access. where they can upload the pictures and

other files. each one has separate user id and password to login and they can view their

files. if they share a particular link using 'tell a friend' button, their friends should be

able to view this page without the login page.. they should be redirected to this page...

how can we do this... please help

page sharing - Sakshi a replied to Indu P on 18-Jan-10 07:22 AM

show those kind of pages without doing any authentication and authorization checks and or also without filtering by authenticated user.



Thanks and Regards,
http://www.CodeCollege.NET
http://www.InterviewsGuru.info


re - Indu P replied to Indu P on 18-Jan-10 07:27 AM

Thanks for the reply

but the user information is needed in this page.. how can we get the user info.. from the login page.. I'm fetching user info from database to login page.. so in this page when someone clicks the link, he/she should be able to view the user specific info.

re - Indu P replied to Sakshi a on 18-Jan-10 07:29 AM

Thanks for the reply
but the user information is needed in this page.. how can we get the user info.. from the

login page.. I'm fetching user info from database to login page.. so in this page when

someone clicks the link, he/she should be able to view the user specific info.

then - Sakshi a replied to Indu P on 18-Jan-10 07:37 AM

1. hav a column in table to store showtofriend information.

2.then fetch the current user specific information and show it

Hope you dont have any difficulty in it, if you have any tell me.


Thanks and Regards,
http://www.CodeCollege.NET
http://www.InterviewsGuru.info


page sharing - mv ark replied to Indu P on 18-Jan-10 07:38 AM
This article shows how you can build the "Tell a Friend" functionality -
http://www.asp101.com/samples/tell_a_friend_aspx.asp

To avoid authentication, append a querystring to the URL that is shared to indicate that a particular page need not be validated. During login validation, allow pages with the specific querystring to proceed without logging in.
Re - Huggy Bear replied to Indu P on 18-Jan-10 07:58 AM
Follow the instructions
1. Generate a GUID and append it as a QueryString in the URL that you will email.
string guid = Guid.NewGuid();
2. Create a mapping table for userId and GUID.
3. When the user clicks on the link Tell a friend, add this GUID to the mapping table against the current user ID.
4. When the user's friend clicks on the link from email, fetch the GUID from the query string and match it against the mapping table. If it contains the GUID received then get that respective user details and show the email receiver with the images of the actual user.
re - Santhosh N replied to Indu P on 18-Jan-10 10:38 AM
Just an enhancement to Huggy Bear's solution..

If you feel difficulty in GUID implementation, you can use anything which is unique but common for the transaction basically (user who wants to share the info and the user who can see this) and this could be used as unique identifier as while sharing the info when viewed...
re - Indu P replied to Santhosh N on 18-Jan-10 11:10 PM
Not sure of GUID implementation.... I'll try.. if u get any sample code please update me.. Thank you very much for the reply
re - Indu P replied to Indu P on 18-Jan-10 11:32 PM
don know how to append it as a query string... please help
re - Indu P replied to Santhosh N on 18-Jan-10 11:32 PM
don know how to append it as a query string... please help
re - Santhosh N replied to Indu P on 19-Jan-10 01:02 AM

If you wanted to approach this by having a querystring then you can define the unique identifier could be guid or any other to be used and store that value in the database against the user needs to be..

in the details page where the page is expected to be common for al the users and authenticated based on the login credentials and have one more querystring id (say by the name uniqueid and read the id from the db for the user and append to the query string while the respective page is requested by the user so that while loading the page, you could read the values from the db based on the id supplied and present to the client userr...