title: ASP.Net MVC: Request variables through Routes and View method
body: <p>Basically if I wanted to make something a search page with paging I would need a url like:</p>
  
  <pre><code>/Topics/Index?search=hi&amp;page=1
  </code></pre>
  
  <p>What I can't seem to figure out is how to:</p>
  
  <p>A)  Set a default route with no search and page 1
      /Topics/Index?page=1 or even /Topics/Index?search=&amp;page=1 </p>
  
  <p>B) use the View method to do the same</p>
  
  <p>I do see that if I have a method on the control:</p>
  
  <pre><code>Index(String search, Int32? page)
  </code></pre>
  
  <p>And use the url:</p>
  
  <pre><code>/Topics/Index?search=hi&amp;page=1 or /Topics/Index?search=hi
  </code></pre>
  
  <p>It gives me what I want in the method.  I just need a way to get a default route for the Topic controller to create a default url with said request variables.  I just don't think that</p>
  
  <p>/Topics/Index/hi/1</p>
  
  <p>Is conducive to a search url, mostly because there's no guarantee I'll have search terms or a page so it could end up like:</p>
  
  <p>/Topics/Index/1 </p>