Solved

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

Posted on 2011-03-08
6
268 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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!

 

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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

617 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