Last post Jul 06, 2009 02:02 AM by sbrahma
Jul 05, 2009 03:46 PM|Striver|LINK
I'm a beginner..
I've written an VB application and have successfuly got it into the form of a web page using Visual Web Developer (VWD).
The application has a link which opens up another web page in a new window. I would like it that code triggered by
a Button on this application will only run if the web page has been opened via this link. In VB it was easy as clicking a Button object made code run (which opened up the WebBrowser within the application) and I could therefore include a line of code
such as eg. trigger=1 (and then later I could use "if trigger=1 then"). But in VWD Toolbox objects "Link" and "Button Link" take you
directly to the web page (ie they are hyperlinks), without giving me the opportunity to include my "trigger=1" line.
Any suggestions please?
Jul 06, 2009 12:59 AM|albarossa|LINK
Are you setting the LinkButton's URL in it's properties section? If so, you need to instead create a click event for the LinkButton the same way you would for a Button, and place the same code that works for the Button into the click code for the LinkButton
- a conditional Response.Redirect.
Jul 06, 2009 01:00 AM|albarossa|LINK
Also, you need to remove the URL for the link from the properties section.
Jul 06, 2009 02:02 AM|sbrahma|LINK
you could do the following in the click event of the link or link button
And then read this value from the query string collection on the page that opens. If this value is 1 then you know that you have come here after your button was clicked.