Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-03-08
6
Medium Priority
?
271 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
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 …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

916 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