How to run this when page loads?

  • Thread starter Miguel Dias Moura
  • Start date
M

Miguel Dias Moura

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
 
J

John Saunders

Miguel Dias Moura said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top