Solved

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

Posted on 2011-03-08
6
265 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Exceptions 3 46
C#  Radio button search for Date not DateTime 4 47
ASP.NET gridview select textbox on focus 2 37
asp enable view state 1 24
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

803 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