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.Send Checked CheckBox values as Comma Separated String to another View using Query String in ASP.Net MVC<p>Hi&nbsp;<a class="username" rel="nauna">nauna,</a></p> <p>Using the article i have created the example.</p> <h1 class="header"><a title="Save (Insert) multiple CheckBoxes (CheckBoxList) values to database in ASP.Net MVC'a" href="https://www.aspsnippets.com/Articles/Save-Insert-multiple-CheckBoxes-CheckBoxList-values-to-database-in-ASPNet-MVC.aspx">Save (Insert) multiple CheckBoxes (CheckBoxList) values to database in ASP.Net MVC</a></h1> <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> <pre class="brush: csharp">public class HomeController : Controller { // GET: /Home/ public ActionResult Index() { HobbiesEntities entities = new HobbiesEntities(); return View(entities.Hobbies.ToList()); } public ActionResult Details(string checkboxaluve) { TempData[&#34;Hobbies&#34;] = checkboxaluve; return View(); } }</pre> <p><strong><span style="text-decoration: underline;">View</span></strong></p> <p><strong>Index</strong></p> <pre class="brush: html">&lt;%@ Page Language=&#34;C#&#34; Inherits=&#34;System.Web.Mvc.ViewPage&lt;IEnumerable&lt;_168965_Checked_CheckBox_QueryString_MVC.Hobby&gt;&gt;&#34; %&gt; &lt;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&gt; &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;.Save&#39;).on(&#34;click&#34;, function () { var hobbies = &#34;&#34;; $(&#34;#tblHobbies input[type=checkbox]:checked&#34;).each(function (index, item) { hobbies += $(item).closest(&#39;tr&#39;).find(&#39;td&#39;).eq(1).text().trim() + &#34;,&#34;; }); var url = $(this).attr(&#39;href&#39;) + &#39;?checkboxaluve=&#39; + hobbies; location.href = url; return false; }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;table id=&#34;tblHobbies&#34;&gt; &lt;% foreach (var item in Model) { %&gt; &lt;tr&gt; &lt;td&gt; &lt;%:Html.CheckBoxFor(m=&gt;item.IsSelected)%&gt; &lt;/td&gt; &lt;td&gt; &lt;%:Html.DisplayFor(m =&gt; item.Hobby1)%&gt; &lt;%:Html.HiddenFor(m =&gt; item.HobbyId)%&gt; &lt;/td&gt; &lt;/tr&gt; &lt;% } %&gt; &lt;/table&gt; &lt;br /&gt; &lt;%:Html.ActionLink(&#34;Send&#34;, &#34;Details&#34;, &#34;Home&#34;, new { }, new { @class = &#34;Save&#34; })%&gt; &lt;/body&gt; &lt;/html&gt; </pre> <p><strong>Details</strong></p> <pre class="brush: html">Hobbies : &lt;%=TempData["Hobbies"]%&gt;&lt;br /&gt; &lt;%:Html.ActionLink("Back", "Index", "Home")%&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/GnDuwYq.gif" alt="" width="250" height="291" /></span></strong></p>https://www.aspforums.net:443/Threads/168965/Send-Checked-CheckBox-values-as-Comma-Separated-String-to-another-View-using-Query-String-in-ASPNet-MVC/https://www.aspforums.net:443/Threads/168965/Send-Checked-CheckBox-values-as-Comma-Separated-String-to-another-View-using-Query-String-in-ASPNet-MVC/Tue, 14 May 2019 03:15:21 GMT