Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery + MVC User Controls
    primarykey
    data
    text
    <p>What I'm trying to do is pass parameters to a user control view which will update a div tag and render the new data based on a hidden user control there. I know how to update a div tag using the Ajax.Form() Helper Method but passing parameters and updating the partial control is beyond me. I've never used jQuery and looked up some tutorials on how to implement it within mvc but I've hit too many dead ends and need some help figuring out a solution. What I currently have is this and need to extend it to update the user control view.</p> <p>ASPX File</p> <pre><code>&lt;form id="formParams"&gt; &lt;input name="textSearch1" type="text" /&gt; &lt;input name="textSearch2" type="text" /&gt; &lt;input name="btnTest" type="submit" onclick="$get('recordsForm').onsubmit()" value="Click Me" /&gt; &lt;/form&gt; &lt;% using (Ajax.Form( "Records", "Search", null, new AjaxOptions { UpdateTargetId = "records", OnSuccess = @"function(sender, args){}", HttpMethod = "GET" }, new { @id = "recordsForm" })) { } %&gt; &lt;div id="records"&gt; &lt;img src="&lt;%= Url.Content("~/Content/Images/load.gif") %&gt;" alt="loading..." /&gt; &lt;/div&gt; </code></pre> <p>ACSX file</p> <pre><code>&lt;%= ViewData["searchText1"].ToString()%&gt; is the search you entered. </code></pre> <p>Controller CS File</p> <pre><code>public ActionResult Records(string searchText1, string searchText2) { ViewData["searchText2"] = searchText2 + " Stop sucking at jQuery Ayo"; ViewData["searchText1"] = searchText1; return View("Records"); } </code></pre>
    singulars
    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