Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery modal prompt before excel import (using MVC 3)?
    primarykey
    data
    text
    <p>Currently I have a link on mvc webgrid page when you click takes you to a view that renders excel results. But, I want to give users another option to include more details. So, I want to add a modal prompt with 2 radio buttons "Export Results" (what is displayed now) and "Export Results with Member details" before going to the view passing "ReportId" (1 or 2). Here's my code, My view would change from MemberstoExcel() to MemberstoExcel(ReportId) with the user input?</p> <p>The link in search view:</p> <pre><code> {@Html.ActionLink("Export Results", "MembersToExcel")} </code></pre> <p>The code in the controller:</p> <pre><code>public ActionResult MemberstoExcel() { var db= new Models.MemberDB(); Spreadsheet mySpreadsheet = new Spreadsheet(); MemberSearch member = new MemberSearch(); var contents = TempData["searchResults"]; IDictionary&lt;string, string&gt; searchConditions = new Dictionary&lt;string, string&gt;(); if (TempData["SearchConditions"] != null) { searchConditions = TempData["SearchConditions"] as Dictionary&lt;string, string&gt;; } this.TempData["SearchConditions"] = searchConditions; ..... code removed for readability...... var results = db.GetMembers(member); mySpreadsheet.contents = results; mySpreadsheet.fileName = "MemberResults.xls"; return View(mySpreadsheet); } </code></pre> <p>The code in excel view:</p> <pre><code> &lt;ss:Worksheet ss:Name="Sheet1"&gt; &lt;ss:Table&gt; @foreach (var content in Model.contents) { &lt;ss:Row&gt; &lt;ss:Cell&gt; &lt;ss:Data ss:Type="String"&gt;@content.fullname&lt;/ss:Data&gt; &lt;/ss:Cell&gt; &lt;ss:Cell&gt; &lt;ss:Data ss:Type="String"&gt;@content.email&lt;/ss:Data&gt; &lt;/ss:Cell&gt; &lt;ss:Cell&gt; &lt;ss:Data ss:Type="String"&gt;@content.companyname&lt;/ss:Data&gt; &lt;/ss:Cell&gt; &lt;ss:Cell&gt; &lt;ss:Data ss:Type="String"&gt;@content.regDate&lt;/ss:Data&gt; &lt;/ss:Cell&gt; &lt;ss:Cell&gt; &lt;ss:Data ss:Type="String"&gt;@content.country&lt;/ss:Data&gt; &lt;/ss:Cell&gt; &lt;ss:Cell&gt; &lt;ss:Data ss:Type="String"&gt;@content.modifiedDate&lt;/ss:Data&gt; &lt;/ss:Cell&gt; &lt;ss:Cell&gt; &lt;ss:Data ss:Type="String"&gt;@content.ciscontactid&lt;/ss:Data&gt; &lt;/ss:Cell&gt; &lt;/ss:Row&gt; } &lt;/ss:Table&gt; &lt;/ss:Worksheet&gt; </code></pre> <p></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