Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to do this in ASP.Net 2.0 ?

Reply
Thread Tools

How to do this in ASP.Net 2.0 ?

 
 
Luqman
Guest
Posts: n/a
 
      02-17-2006
A user should be able to access the page 2 only via Page 1.

If he tries to go to page 2 directly, unauthorised access error should
occur.

Any idea please ?

Best Regards,

Luqman


 
Reply With Quote
 
 
 
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      02-17-2006
Well, you can do it with a server.transfer

sub SomeButton_OnClick
Context.Items.Add("AccessOk", true)
Server.Transfer("page2.aspx")
end sub

page2_pageload
if Context.Items("AccessOk") is nothing then
'access denied
end if
...
end sub

--
http://www.openmymind.net/



"Luqman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>A user should be able to access the page 2 only via Page 1.
>
> If he tries to go to page 2 directly, unauthorised access error should
> occur.
>
> Any idea please ?
>
> Best Regards,
>
> Luqman
>
>



 
Reply With Quote
 
 
 
 
clintonG
Guest
Posts: n/a
 
      02-17-2006
When using ASP I used to set a value for a Session variable only when
Page1.asp was loaded. Each time Page2 is loaded I would check the Session
variable -- and -- I would check the HTTP_REFERER Server variable when Page2
loads. If both variables were empty I would redirect somewhere. If not Page2
could be used.

Using the Session variable ensured me that at least Page1 was being viewed.
The HTTP_REFERER value ensured me that a click event in Page1 was used to
request Page2.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/



"Luqman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>A user should be able to access the page 2 only via Page 1.
>
> If he tries to go to page 2 directly, unauthorised access error should
> occur.
>
> Any idea please ?
>
> Best Regards,
>
> Luqman
>
>



 
Reply With Quote
 
Bruce Barker
Guest
Posts: n/a
 
      02-17-2006
one cavet, many personal firewalls, or proxy servers strip the HTTP_REFERER
tag

-- bruce (sqlwork.com)

"clintonG" <(E-Mail Removed)> wrote in message
news:ODd6pm%(E-Mail Removed)...
> When using ASP I used to set a value for a Session variable only when
> Page1.asp was loaded. Each time Page2 is loaded I would check the Session
> variable -- and -- I would check the HTTP_REFERER Server variable when
> Page2 loads. If both variables were empty I would redirect somewhere. If
> not Page2 could be used.
>
> Using the Session variable ensured me that at least Page1 was being
> viewed. The HTTP_REFERER value ensured me that a click event in Page1 was
> used to request Page2.
>
> <%= Clinton Gallagher
> NET csgallagher AT metromilwaukee.com
> URL http://clintongallagher.metromilwaukee.com/
>
>
>
> "Luqman" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>A user should be able to access the page 2 only via Page 1.
>>
>> If he tries to go to page 2 directly, unauthorised access error should
>> occur.
>>
>> Any idea please ?
>>
>> Best Regards,
>>
>> Luqman
>>
>>

>
>



 
Reply With Quote
 
clintonG
Guest
Posts: n/a
 
      02-18-2006
Yea I know but thanks for pointing it out for others. I did a whole survey
of this variable to determine how to use it but never "blogged" on it.
Basically I learned this variable comes from the Johnny Cocharan School of
Web Development. "If there is no click you can not commit!"

I'll tell ya something you could comment on if you wish...
I'm using a 2.0 Wizard Control to generate XML. I need to output the XML to
display -- and -- the file system -- and -- I also want to shred it into
SQL2005 which in the order of operations should I assume be done last. I do
all the XmlWriter operations in the Wizard control's click event handler.
Besides the native support now available in SQL2005 what technique would you
use to shred the XML into SQL2005?

<%= Clinton Gallagher

"Bruce Barker" <(E-Mail Removed)> wrote in message
news:%23PFRbv%(E-Mail Removed)...
> one cavet, many personal firewalls, or proxy servers strip the
> HTTP_REFERER tag
>
> -- bruce (sqlwork.com)
>
> "clintonG" <(E-Mail Removed)> wrote in message
> news:ODd6pm%(E-Mail Removed)...
>> When using ASP I used to set a value for a Session variable only when
>> Page1.asp was loaded. Each time Page2 is loaded I would check the Session
>> variable -- and -- I would check the HTTP_REFERER Server variable when
>> Page2 loads. If both variables were empty I would redirect somewhere. If
>> not Page2 could be used.
>>
>> Using the Session variable ensured me that at least Page1 was being
>> viewed. The HTTP_REFERER value ensured me that a click event in Page1 was
>> used to request Page2.
>>
>> <%= Clinton Gallagher
>> NET csgallagher AT metromilwaukee.com
>> URL http://clintongallagher.metromilwaukee.com/
>>
>>
>>
>> "Luqman" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>A user should be able to access the page 2 only via Page 1.
>>>
>>> If he tries to go to page 2 directly, unauthorised access error should
>>> occur.
>>>
>>> Any idea please ?
>>>
>>> Best Regards,
>>>
>>> Luqman
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments