Okay, I will give a broad overview of how I'd go about this, as I've done something a bit similar, though not with ASP.net (so there won't be any code, and please don't ask for any, as I'm making it up as I go along :) ).
<div id="search_template" class="search_row">
... <!-- In here goes the actual content-->
e.g. <input type="text" id="search_template_content"/>
". You can do that just with an innerHTML replace, in most cases:
var templatename = baseid + 'template';
var template = document.getElementById(templatename);
var indexer = 1;
while(null != document.getElementById(baseid + indexer)) indexer++;
var newdiv = document.createElement('div');
var newname = baseid + indexer;
newdiv.id = newname;
newdiv.innerHTML = template.innerHTML.replace(new RegExp(templatename), newname);
var containerdiv = document.getElementById('search_container');
And obviously now you need to have a search_container:
<div id="search_container" style="margin: 0; padding: 0" />
<input type="button" value="Add entry" onclick="clone('search_')"/>
Finally, you probably want to call
in your body.onload handler or in inline script, so you get one search criteria row to start with.
you will receive a set of query pairs that look like
... which you will have to use Request.Form to look through and create the search logic appropriately.
This is getting long enough to be an article so I'll stop there :P ... that should be enough to set you on the right path at least.