Note that there are some explanatory texts on larger screens.

plurals
  1. POMVC3 Updating Get Method Parameters. Not working from same View
    primarykey
    data
    text
    <p>I am using MVC3 and having problems when I call a Get Method.</p> <p>When I call this code in razor from other View is working well. It sends the keyword, location parameters with the correct present value.</p> <p><strong>View</strong></p> <pre><code>@using (Html.BeginForm("ListSearch", "Job",FormMethod.Get,null)) { &lt;div id="searchBoxes"&gt; &lt;div id="keywordsSearchBox" &gt; &lt;input id="keywords_search_small" type="text" tabindex="2" title="@Resources.What" name="keyword"&gt; &lt;div class="searchExplain_small"&gt;@Resources.KeywordSearchDesc&lt;/div&gt; &lt;/div&gt; &lt;div id="locationSearchBox"&gt; &lt;input id="location_search_small" type="text" tabindex="3" title="@Resources.Where" name="location" autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true"&gt; &lt;div class="searchExplain_small"&gt;@Resources.LocationSearchDesc&lt;/div&gt; &lt;/div&gt; &lt;div id="searchButtonBox_small"&gt; &lt;input id="btnSearch" type="submit" value="@Resources.Search" role="textbox" aria-autocomplete="list" aria-haspopup="true"/&gt; &lt;/div&gt; &lt;/div&gt; } </code></pre> <p><strong>Controller</strong></p> <pre><code>public ViewResult ListSearch(string keyword, string location,int page =1) .... </code></pre> <p>But, when I am calling the same Get Method from the same view, MVC doesn't update the keyword, location parameters. Instead, it's sending the previous keyword, location parameters.</p> <p>I am using the same razor code in the home and listSearch view.</p> <p><strong>Examples URLs</strong></p> <pre><code>Home Page =&gt; Call GET Method ListSearch (keyword=manager, location=Richmond) http://localhost:4838/Home/Index =&gt; http://localhost:4838/Job/ListSearch?keyword=manager&amp;location=Richmond List Search Page =&gt; Call GET Method ListSearch (keyword=lawyer, location=Miami) http://localhost:4838/Job/ListSearch?keyword=manager&amp;location=Richmond =&gt; http://localhost:4838/Job/ListSearch?keyword=manager&amp;location=Richmond </code></pre> <p>The parameters are not changing</p> <p>Any idea of how I can solve it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload