ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Pass value from one View to another with QueryString using ActionLink in ASP.Net MVC<p>Hi&nbsp;nauna,</p> <p>Check this example. Now please take its reference and correct your code.</p> <p><strong><span style="text-decoration: underline;">Controller</span></strong></p> <p><strong>Home</strong></p> <pre class="brush: csharp">public class HomeController : Controller { // GET: /Home/ public ActionResult Index() { return View(); } }</pre> <p><strong>Details</strong></p> <pre class="brush: csharp">public class DetailsController : Controller { // GET: /Details/ public ActionResult Index() { return View(); } public ActionResult Details(string name, string mobile) { TempData[&#34;Name&#34;] = name; TempData[&#34;Mobile&#34;] = mobile; return View(); } }</pre> <p><strong><span style="text-decoration: underline;">View</span></strong></p> <p><strong>Home</strong></p> <pre class="brush: html">&lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head runat=&#34;server&#34;&gt; &lt;title&gt;Index&lt;/title&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://code.jquery.com/jquery-2.2.3.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; $(function () { $(&#39;.Redirect&#39;).on(&#34;click&#34;, function () { var name = $(&#39;#TxtName&#39;).val(); var mobile = $(&#39;#TxtMobile&#39;).val(); var url = $(this).attr(&#39;href&#39;) + &#39;?Name=&#39; + name + &#39;&amp;Mobile=&#39; + mobile; location.href = url; return false; }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt; &lt;%using (Html.BeginForm()) {%&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Enter Your Name&lt;/td&gt; &lt;td&gt;:&lt;/td&gt; &lt;td&gt;&lt;%:Html.TextBox(&#34;TxtName&#34;)%&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Enter Your Mobile No&lt;/td&gt; &lt;td&gt;:&lt;/td&gt; &lt;td&gt;&lt;%:Html.TextBox(&#34;TxtMobile&#34;)%&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Enter Your EmailID&lt;/td&gt; &lt;td&gt;:&lt;/td&gt; &lt;td&gt;&lt;%:Html.TextBox(&#34;TxtEmailID&#34;)%&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Enter Your Address&lt;/td&gt; &lt;td&gt;:&lt;/td&gt; &lt;td&gt;&lt;%:Html.TextBox(&#34;TxtAddress&#34;)%&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;%:Html.ActionLink(&#34;Create&#34;, &#34;Details&#34;, &#34;Details&#34;, new { }, new { @class = &#34;Redirect&#34; })%&gt; &lt;%} %&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;</pre> <p><strong>Details</strong></p> <pre class="brush: html">&lt;body&gt; Name : &lt;%=TempData[&#34;Name&#34;]%&gt;&lt;br /&gt; Mobile : &lt;%=TempData[&#34;Mobile&#34;]%&gt; &lt;/body&gt;</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><strong><span style="text-decoration: underline;"><img src="https://i.imgur.com/1FDDFrw.gif" alt="" width="359" height="191" /></span></strong></p>https://www.aspforums.net:443/Threads/129732/Pass-value-from-one-View-to-another-with-QueryString-using-ActionLink-in-ASPNet-MVC/https://www.aspforums.net:443/Threads/129732/Pass-value-from-one-View-to-another-with-QueryString-using-ActionLink-in-ASPNet-MVC/Mon, 13 May 2019 03:30:37 GMT