• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

I have two questions.... How do I create a hyperlink on a vb.net form that sends the user to the previous selection screen with all of the selection criteria he entered still there

How do I create a hyperlink in a VB.NET form that will take the user to the previous selection screen. The screen needs to have all the data in it that he entered before clicking the search button. The hyperlink is going to be named refine search. It takes the user to the previous selection screen so he can refine his search. It still has everthing he entered prevously in it.



Question 2 I will ask in a seperate question and give it 500 pts just like this one.
0
lvandevender
Asked:
lvandevender
  • 4
  • 2
  • 2
  • +1
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
WinForms or WebForms?
0
 
lvandevenderAuthor Commented:
webform
0
 
lvandevenderAuthor Commented:
Yes its a webform
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
w3timCommented:
Hi lvandervender,

This really will depend on how you want to implement it.  Do you want to use a single page for both the search and for the results or is it going to be two seperate ASPX pages?

Thanks,
Tim
0
 
lvandevenderAuthor Commented:
The search page and the results page are different. The refine search goes back to the original search page but it has all the data that was entered before the submit search button was clicked.
0
 
w3timCommented:
Hi there lvandervender,

One way to do it is to perhaps use a linkbutton on the second page (as the "refine search" button).

In the code for that button, add in code similar to the following;
        Dim s As String
        s += "page1.aspx"                   ' This is the page you execute the search from
        s += "?action=refine"               ' This allows the search page to identify the fact that the person is returning to refine the search
        s += "&field1=" & Request("field1").ToString ' Replace the "field1" with the name of the field in the first form
        s += "&field2=" & Request("field2").ToString ' Same as above
        Response.Redirect(s)

Then, in the Page_Load of the search page (first page), add something like;
If Request("action") = "refine" Then
       field1.Text = Request("field1").ToString
       field2.Text = Request("field2").ToString
End If

Hope this helps, it's a fairly simple solution but it should work fairly well.

Tim
0
 
armoghanCommented:
The simplest thing of all is to add a Javascript to the link something like
onclick="history.back()"


http://www.sbrady.com/hotsource/javascript/back.html

e.g. In google screen type anything and then search , then press back button it has the searched string in it
Probably Same thing you need to do
0
 
lvandevenderAuthor Commented:
i used the history.back line of code on site u gave me and i get an error message that says "history not defined" not sure what do with that my code was this

<HTML>
<HEAD>
<TITLE>My Web Page</TITLE>
</HEAD>
<BODY>

<form>
<input type="button" value="Back" onclick="history.back()">
</form>




0
 
armoghanCommented:
I have created two file on Desktop for example purpose.

1.  html1.html

<HTML>
<HEAD>
<TITLE>My Web Page</TITLE>
</HEAD>
<BODY>
<form>
<input type=text value="hello">
</form>
<a href=html2.html>Go to Html2</a>
</BODY>
</HTML>


2.  html2.html

<HTML>
<HEAD>
<TITLE>My Web Page</TITLE>
</HEAD>
<BODY>

<form>
<input type="button" value="Back" onclick="history.back()">
</form>
</body>
</html>

First i opened the html1.html changed the value of hello and then I clicked to go to next link , then clicked the back button and i am bakc on html1 with the cahnged text
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now