Solved

asp.net page - if page.previouspate...

Posted on 2011-03-08
6
264 Views
Last Modified: 2012-05-11
Hi,

I am looking at making images/links visible and invisible when a user is redirected from a page but do not know really where to start on this one.

I have been looking round and found

if page.previouspage ! = (page.aspx) then
result here
end if

but this doesnt work...

Any suggestions?

Thanks

0
Comment
Question by:SimonPrice33
  • 4
  • 2
6 Comments
 
LVL 7

Expert Comment

by:nbove
ID: 35070672
There are several ways to go about doing this.  Probably the easiest way would be to use query string parameters.

Code for page doing the redirect:
Response.Redirect("NewPage.aspx?showImage1=true&showImage2=false")

Code for page selectively displaying images/links:
protected void Page_Load(object sender, EventArgs e) {
  image1.Visible = bool.Parse(Request.QueryString["showImage1"]);
  image2.Visible = bool.Parse(Request.QueryString["showImage2"]);
}
0
 

Author Comment

by:SimonPrice33
ID: 35070859
Thank you for your response, I see that you have provided a solution in c#, and apologise for not saying earlier, but I am writing in VB.NET.

I have tried the request.querystring as you suggest, however this is coming up with a value of type system.collections.specialised.namevaluecollection cannot be converted to string.

Any suggestions?

0
 
LVL 7

Expert Comment

by:nbove
ID: 35072658
It has been quite some time since I have written VB.NET code, if I remember correctly, it would look something like this::
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
  image1.Visible = Boolean.Parse(Request.QueryString("showImage1"))
  image2.Visible = Boolean.Parse(Request.QueryString("showImage2"))
End Sub
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:SimonPrice33
ID: 35080392
Hi,

after looking at your c# code yesterday I tried it this way and unfortunately it didnt work :(

I will continue to to try and modify this...

Thanks

Simon
0
 

Accepted Solution

by:
SimonPrice33 earned 0 total points
ID: 35874339
have been unable to find a working solution so have given up on this idea... and will close the question.
0
 

Author Closing Comment

by:SimonPrice33
ID: 35906678
.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now