asp.net - concatenate a string from multiple input textboxes -
asp.net - concatenate a string from multiple input textboxes -
i have cshtml page inquire user provide input info need concatenate string build dynamic linq query in controller. view not utilize model. here html code far.
<div id="filter"> come in client name. can part of name broader results. (optional) <br /> <input type="text", id="customer", value="") /> <br /> come in case status ( open or closed ), or leave blank both. (optional) <br /> <input type="text", id="status", value="") /> <br /> come in date range filter date. (optional) <br /> start date <input type="text", id="startdate", value="") /> end date <input type="text", id="enddate", value="") /> <br /> come in promoid (optional) <br /> <input type="text", id="promoid", value="") /> <br /> come in complaint code (optional) <br /> <input type="text", id="complaintcode", value="") /> </div> @html.actionlink("export case info excel analysis", "casereport", "reports", "excel", new { stringfilter = mystring })
the controller action has string parameter called stringfilter. need build string filter , pass controller. using dynamic linq query library.
how can string values dom?
the 1 thing can concatenate them in button-click event handler, somethingk like..
class="lang-js prettyprint-override">$('#form-input-submit-button').click(function() { /* here & submit. */ });
but recommend have in mvc controller action method parameters need
[httppost] public void casereport(string promoid, string coplaintcode, ... ) { }
or improve have typed model
public class reportmodel { public string promoid { get; set; } public string complaintcode { get; set; } ... }
so just:
[httppost] public void casereport(reportmodel model) { /* validate modelstate */ }
actually, model in mvc acronym need.
but the
[httppost] public void casereport(formcollection form) { }
to see incoming data.
asp.net asp.net-mvc-3 linq razor
Comments
Post a Comment