To note a web page visited

Last post 07-06-2009 2:02 AM by sbrahma. 3 replies.

Sort Posts:

  • To note a web page visited

    07-05-2009, 3:46 PM
    • Member
      point Member
    • Striver
    • Member since 06-09-2009, 2:33 PM
    • Posts 2

    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). LaughingThe 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?

    Thanks,

    Striver

  • Re: To note a web page visited

    07-06-2009, 12:59 AM
    • Member
      348 point Member
    • albarossa
    • Member since 04-03-2008, 6:39 PM
    • Posts 68

    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.

  • Re: To note a web page visited

    07-06-2009, 1:00 AM
    • Member
      348 point Member
    • albarossa
    • Member since 04-03-2008, 6:39 PM
    • Posts 68

    Also, you need to remove the URL for the link from the properties section.


  • Re: To note a web page visited

    07-06-2009, 2:02 AM
    • Member
      34 point Member
    • sbrahma
    • Member since 05-06-2009, 11:54 PM
    • Posts 7

    you could do the following in the click event of the link or link button

    Response.Redirect("MyNewPage.aspx?trigger=1",true );

    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.





Page 1 of 1 (4 items)