Ordering javascript code on a page executed with argument calculated in codebehind in ASP.NET
<p>A situation requires me to order javascript code on a page be executed with an argument calculated in codebehind in ASP.NET</p>

<p>Here is the situation:</p>

<p>I have a page called search.aspx . This page contains a button and a textbox. Users put their arguments for search in the textbox and then click the button. The button posts back and runs a button click method. This code behind logic (running on the server) serializes and inserts the contents of the textbox to a DB. </p>

<p>Assuming a rowID or something to identify the serialized query by will be returned inside the button click method, how can I then tell the page (search.aspx) to open a new tab with results.aspx?query=.</p>

<p>I know I have to use javascript as the code behind can't open a new tab, but I am just wondering how to do so.</p>

<p>I've never used JS so a maximum amount of details in the answer is better.</p>
