title: Simple search on masterpage and display results on a different page
body: <p>I'm still a beginner at ASP.NET and C#. In my current project, I have to do a "simple search".</p>
  
  <p>My search bar is on the master page and I want the results of the search to be displayed on <code>Searchside.aspx</code>. I just want to be able to search on <code>slips_navn</code> (tie_name) in my database.</p>
  
  <p>This is what I currently have and I don't know how to move on from here.</p>
  
  <p><strong>MasterPage button / textbox</strong></p>
  
  <pre><code>&lt;asp:TextBox ID="SearchTextBox" runat="server"&gt;&lt;/asp:TextBox&gt;
  &lt;asp:Button ID="ButtonSearch" runat="server" Text="Søg" OnClick="ButtonSearch_Click" /&gt;
  </code></pre>
  
  <p><strong>Code behind Master page</strong></p>
  
  <pre><code>protected void ButtonSearch_Click(object sender, EventArgs e)
  {
  
      Response.Redirect("~/searchside.aspx?SearchText=" + SearchTextBox.Text);   
  
  }
  </code></pre>
  
  <p><strong>Searchside.aspx</strong></p>
  
  <p>And this is where i want to display the results.</p>
  
  <pre><code> &lt;div id="randomslips"&gt;
       &lt;b&gt;&lt;%#Eval("maerke_navn") %&gt;&lt;/b&gt;
       &lt;p&gt;&lt;%#Eval("slips_navn") %&gt;&lt;/p&gt;
       &lt;img alt="" src='prod_image2/&lt;%# Eval("billede") %&gt; ' height="100px" width="100px" /&gt;
       &lt;b&gt;DKK&lt;%#Eval("slips_pris") %&gt;,-&lt;/b&gt;
       &lt;a class="Infoknap" href='EnkeltSlips.aspx?id=&lt;%#Eval("Slips_id") %&gt;'&gt;INFO&lt;/a&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p><strong>My Tie table.</strong>(slips)</p>
  
  <pre><code>CREATE TABLE [dbo].[slips] (
      [slips_id]    INT             IDENTITY (1, 1) NOT NULL,
      [slips_tekst] NVARCHAR (MAX)  NOT NULL,
      [slips_pris]  DECIMAL (18, 2) NOT NULL,
      [billede]     NVARCHAR (MAX)  NOT NULL,
      [slips_navn]  NVARCHAR (50)   NOT NULL,
      [FK_maerke]    INT             NOT NULL,
      [status]      INT             NOT NULL,
      PRIMARY KEY CLUSTERED ([slips_id] ASC),
      CONSTRAINT [FK_Slips_maerke] FOREIGN KEY ([FK_maerke]) REFERENCES [dbo].[maerke] ([maerke_id]) ON DELETE CASCADE
  );
  </code></pre>
  
  <p>Maerke table (Brand)</p>
  
  <pre><code>( 
  
  CREATE TABLE [dbo].[maerke] (
      [maerke_id]   INT           IDENTITY (1, 1) NOT NULL,
      [maerke_navn] NVARCHAR (50) NOT NULL,
      PRIMARY KEY CLUSTERED ([maerke_id] ASC)
  );
  </code></pre>
  
  <p>So thus far, when i press the Search button on master page, i get redirected to <strong>searchside.aspx?SearchText=blue</strong> as it should, but i dont know how i should connect to the database, via codebehind and how? or via sql-datasource / repeater and how?. i included the 2 database tables i expect to search from, i again, want to search on <strong>tie_name ( slips_navn )</strong> Row. i apologies if im still not being clear, and i will try to update my question again untill hopefully i can explain what i want answered :)</p>