How to run this when page loads?

Discussion in 'ASP .Net' started by Miguel Dias Moura, Dec 9, 2004.

  1. Hello,

    I have an ASP.NET/VB web page (search.aspx) with a search form.
    When the button is pressed the keywords are passed like this:

    Sub searchClick(sender As Object, e As System.EventArgs)
    Response.Redirect("search.aspx?list=" & Request.Form("keywords"))
    End Sub

    To split the keywords I can use:
    string[] aryValues = Request.QueryString("search").Split(' ');

    How can I run this when the page is loaded and only if "list" is not
    empty?

    Thanks,
    Miguel
     
    Miguel Dias Moura, Dec 9, 2004
    #1
    1. Advertising

  2. "Miguel Dias Moura" <md*REMOVE*moura@*NOSPAM*gmail.com> wrote in message
    news:...
    > Hello,
    >
    > I have an ASP.NET/VB web page (search.aspx) with a search form.
    > When the button is pressed the keywords are passed like this:
    >
    > Sub searchClick(sender As Object, e As System.EventArgs)
    > Response.Redirect("search.aspx?list=" & Request.Form("keywords"))
    > End Sub
    >
    > To split the keywords I can use:
    > string[] aryValues = Request.QueryString("search").Split(' ');
    >
    > How can I run this when the page is loaded and only if "list" is not
    > empty?


    You can put the code in Page_Load.


    John Saunders
     
    John Saunders, Dec 9, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nathon Dalton

    Help, page loads twice

    Nathon Dalton, Jun 26, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    578
    Nathon Dalton
    Jun 26, 2003
  2. Scott F. Brown

    Slow page loads, possible security issue?

    Scott F. Brown, Oct 21, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    362
  3. aDc
    Replies:
    4
    Views:
    531
  4. rb
    Replies:
    0
    Views:
    402
  5. TonyJeffs
    Replies:
    2
    Views:
    97
    TonyJeffs
    Sep 29, 2003
Loading...

Share This Page