the following action link does not bind data between two date but its bind the default list when the page is first displayed .EveryTime it binds default list.I am Sending this to partial page which in inside view page..
public ActionResult SearchByTodate(string fdate, string todate)
{
SecretaryUserModel secretarymodel = new SecretaryUserModel();
ExpensesBL expbl = new ExpensesBL();
var expenseslist = expbl.GetExpensesList();
foreach (var data in expenseslist)
{
secretarymodel.ExpensesList.Add(new SelectListItem
{
Text = data.Expenses_Name,
Value = data.ID.ToString(),
});
}
secretarymodel.selectedexpensesid = secretarymodel.Expenses_ID;
secretarymodel.ExpensesList.Add(new SelectListItem
{
Text = "All",
Value = "0",
Selected = true
});
ParticularsBL objparticulars = new ParticularsBL();
DateTime frdate = Convert.ToDateTime(fdate);
DateTime tdate = Convert.ToDateTime(todate);
DataTable searchbydate = OBJ.Fetch_PartDetailsBytdate(frdate, tdate);
var builder = new StringBuilder();
if (searchbydate.Rows.Count > 0)
{
int i = 0;
builder.Append("");
");
| "); builder.Append(""); builder.Append(" | ");"); if (str == "TransactionDate") builder.Append(" "); | if (str == "Particular") builder.Append(" "); | if (conditionforth >= 3) { builder.Append(" "); | "); } conditionforth++; builder.Append(str); builder.Append(" i++; } if (conditionforth >= 3) builder.Append(" "); | "); builder.Append("Remarks"); builder.Append(" if (conditionforth >= 3) builder.Append(" "); | "); builder.Append("Action"); builder.Append(" builder.Append(" |
|---|---|---|---|---|---|---|
| "); builder.Append(" | ");||||||
| "); builder.Append(""); builder.Append(" | ");"); builder.Append(Convert.ToString(searchbydate.Rows[row][column])); builder.Append(" | ");"); builder.Append("Paid"); builder.Append(" | ");"); int id = Convert.ToInt32(searchbydate.Rows[row][0]); if (id > 0) { } else { } builder.Append(" | ");
string strblder = builder.ToString();
ViewBag.testing = builder.ToString();
}
else
{
builder.Append("");
");
| "); builder.Append(""); builder.Append(" | ");"); if (str == "TransactionDate") builder.Append(" "); | if (str == "Particular") builder.Append(" "); | if (conditionforth >= 3) { builder.Append(" "); | "); } conditionforth++; builder.Append(str); builder.Append(" i++; } if (conditionforth >= 3) builder.Append(" "); | "); builder.Append("Remarks"); builder.Append(" if (conditionforth >= 3) builder.Append(" "); | "); builder.Append("Action"); builder.Append(" builder.Append(" |
|---|---|---|---|---|---|---|
| "); builder.Append(" | ");
ViewBag.testing = builder.ToString() ;
}
return View();
}
Manas MohapatraPosted Jul 19, 2016, 2:40 AM