I'm trying to receive Business Account info through the rest API. I try with a filter and without the filter. It is using the default end point and the default BusinessAccount. The results of both runs are below after the code.
My code to get the Acumatica content
public async void GetCustomersActivitiesAsync(int top, string filterOperation, string filter)
{
string url = settings.url + settings.endpoint + "BusinessAccount";
string parametersFilter = "&$filter=BusinessAccount eq 'ABARTENDE'";
var uri = new Uri(url + parametersFilter);
try
{
var response = await client.GetAsync(uri);
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
}
else
{
err = await response.Content.ReadAsStringAsync();
try
{
ResponseMessage msg = JsonConvert.DeserializeObject<ResponseMessage>(err);
if (msg != null && msg.exceptionMessage != "") err = msg.exceptionMessage;
}
catch (Exception ex)
{
err = ex.Message;
}
}
}
catch (Exception ex)
{
Debug.WriteLine(#" ERROR {0}", ex.Message);
err = ex.Message;
}
}
When I run the filter it fails auto manically
When I do a filter it returns this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"><link href="/A000/Content/font-awesome.css?timestamp=636698449900000000" type="text/css" rel="stylesheet" /><link href="/A000/App_Themes/Default/00_Controls.css?timestamp=636698449900000000" type="text/css" rel="stylesheet" /><title>
Error Has Occurred
</title><meta http-equiv="content-script-type" content="text/javascript" />
<style type="text/css">
.main
{
padding-left: 40px;
padding-right: 20px;
padding-top: 30px;
font-family: Arial;
}
.errCode
{
padding-bottom: 20px;
font-family: Arial;
font-size: 15pt;
}
.errMsg
{
font-size: 12pt;
}
.img
{
float: left;
margin-right: 10px;
}
.nxtSt
{
margin-top: 30px;
font-family: Arial;
font-size: 15pt;
}
.navTo
{
margin-top: 10px;
margin-left: 20px;
}
.errPnl
{
padding: 10px;
padding-top: 15px;
}
.grayBox
{
border: solid 1px #CCC;
background-color: #F9F9F9;
padding-top: 20px;
padding-bottom: 25px;
padding-left: 10px;
padding-right: 20px;
}
.traceLnk
{
margin-top: 20px;
}
</style>
<style type="text/css">
.frmBottom_CaptionL { background-position:left top;width:5px; }
.frmBottom_CaptionR { background-position:right top;width:5px; }
.frmBottom_CaptionM { }
</style></head>
<body>
<form name="form1" method="post" action="./Error.aspx" id="form1">
<input type="hidden" name="__RequestVerificationToken" id="__RequestVerificationToken" value="Aq4LEYY5T50IzZfjFHxJWWVP0lq4kLBG-ljIPF3eUYBdBo3UHLHNgHdHF8YW9hpS3nHqiATSFrDybUkJvaXapM_ZItg1" />
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="frmBottom_state" id="frmBottom_state" value="" />
<input type="hidden" name="__SmartPanelVisible" id="__SmartPanelVisible" value="" />
<input type="hidden" name="L10nEditor_state" id="L10nEditor_state" value="" />
<input type="hidden" name="inputBox_state" id="inputBox_state" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="" />
<script type="text/javascript">
//<![CDATA[
var __appPath = '/A000/';var __nodePath="";var __nodeGuid="00000000-0000-0000-0000-000000000000";//]]>
</script>
<script src="/A000/PX.ScriptBatch.axd?d=cFBYLldlYi5VSXxQWC5XZWIuVUkuRXh00&t=636698318120000000" type="text/javascript"></script>
<script src="/A000/PX.ScriptBatch.axd?d=cFBYLldlYi5VSXxQWC5XZWIuVUkuQmFzZQ2&t=636698318120000000" type="text/javascript"></script>
<script src="/A000/PX.ScriptBatch.axd?d=cFBYLldlYi5VSXxQWC5XZWIuVUkuRWRpdA2&t=636698318120000000" type="text/javascript"></script>
<script src="/A000/PX.ScriptBatch.axd?d=cFBYLldlYi5VSXxQWC5XZWIuVUkuR3JpZA2&t=636698318120000000" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
var __loadImgUri = "/A000/App_Themes/Default/Images/spinner.gif?imgTimeStamp=636698449900000000";
var __loadStr = "";
var _numbFormatInfo = {negativeSign:"-",currencySymbol:"$",percentSymbol:"%",number:{groupSeparator:",",decimalSeparator:".",groupSizes:[3],negativePattern:1,decimalDigits:2},currency:{groupSeparator:",",decimalSeparator:".",groupSizes:[3],positivePattern:0,negativePattern:0,decimalDigits:2},percent:{groupSeparator:",",decimalSeparator:".",groupSizes:[3],positivePattern:1,negativePattern:1,decimalDigits:2}};
var _dateFormatInfo = {am:"AM",pm:"PM",shortDate:"M/d/yyyy",shortTime:"h:mm tt",longDate:"dddd, MMMM d, yyyy",longTime:"h:mm:ss tt",timeSeparator:":",yearFix:0,monthNames:"January,February,March,April,May,June,July,August,September,October,November,December,",abbrMonthNames:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,",dayNames:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",abbrDayNames:"Sun,Mon,Tue,Wed,Thu,Fri,Sat"};
__createPxContext(window);
var __PXFormView = {maxFileSizeMsg:"The file exceeds the maximal allowed size (25000 KB).",allowedFiles:".als;.cer;.csv;.dat;.doc;.docx;.epl;.exe;.gif;.ico;.ics;.jpeg;.jpg;.js;.mdb;.msi;.ofx;.pdf;.pfx;.ppt;.pptx;.qbo;.qfx;.rar;.rtf;.sql;.swf;.txt;.xls;.xlsx;.xml;.zip;.zpl;.pbix;.png;.svg;.tif;.tiff",allowedFilesMsg:"Only the following file types are allowed: {0}.",callbacks:[{name:"Refresh",repaintControls:1,blockPage:1,postData:0},{name:"Search",repaintControls:1,blockPage:1},{name:"Save",repaintControls:1,blockPage:1,commitChanges:1},{name:"Delete",repaintControls:1,blockPage:1},{name:"AddNew",repaintControls:1,blockPage:1,postData:0},{name:"NoteShow",blockPage:1,postData:0},{name:"NoteSave",repaintControls:3,blockPage:1,postData:0},{name:"FilesMenuShow",blockPage:1,postData:0},{name:"ActivityShow",blockPage:1,postData:0},{name:"LinkShow",repaintControls:3,blockPage:1,postData:0},{name:"LinkUpdate",repaintControls:3,blockPage:1,postData:0},{name:"LinkSend",repaintControls:3,blockPage:1,postData:0},{name:"NotifyMenuShow",repaintControls:3,blockPage:1,postData:0},{name:"NotifyShow",repaintControls:3,blockPage:1,commitChanges:1,postData:0},{name:"CheckActivity",blockPage:1,postData:0},{name:"UploadFile",blockPage:1}],errorCss:"FormError",warningCss:"FormWarn",infoCss:"FormInfo",minHeight:63,filesMenuUrls:{filesDisplayUrl:"~/Frames/GetFile.ashx",fileInfoUrl:"~/Pages/SM/SM202510.aspx"}};
var _frmBottom = {allowCollapse:0,minHeight:0,autoSize:{enabled:1,container:1}};
var _confirmMsg = "Any unsaved changes will be discarded.";
var __PXSmartPanel = {callBackMode:{blockPage:1,postData:0}};
var _L10nEditor = {loadOnDemand:1,autoReload:1,commandName:"SaveLoc",autoCallBack:{behavior:{postData:0}}};
var __PXInputBox = {activeEnter:0,buttonCss:"MessageButton",autoAdjustSize:1,callBackMode:{blockPage:1,postData:0}};
var _inputBox = {};
//]]>
</script>
<div class="main">
<div name="frmBottom" id="frmBottom">
<div style="position:relative;">
<div class="errCode">
</div>
<div class="grayBox">
<div class="img">
<img id="frmBottom_imgMessage" tabindex="100" src="../App_Themes/Default/Images/Message/error2.gif" border="0" />
</div>
<div class="errMsg">
<span id="frmBottom_lblMessage" class="errMsg">We're sorry! An error has occurred while processing your request. A report has been generated for our technical staff to investigate the problem. Please try to repeat your request later. Thank you for understanding.</span>
</div>
</div>
<div class="traceLnk">
<a id="frmBottom_lnkTrace" tabindex="101" href="Trace.aspx"><u><font color="Blue" size="4">Show Trace</font></u></a>
</div>
<div class="nxtSt">
</div>
<div class="navTo">
</div>
</div>
</div>
</div>
<table name="L10nEditor" cellspacing="0" cellpadding="0" id="L10nEditor" tabindex="300" class="SmartPanel" style="display:none;">
<tr>
<td id="L10nEditor_cap" class="SmartPanelC" valign="middle"><div class="sprite-icon control-icon" icon="Close" mode="c" style="float:right;">
<div class="control-icon-img control-Close">
</div>
</div>Translations</td>
</tr><tr>
<td class="SmartPanelCN" id="L10nEditor_cont" width="0" height="0"><div class="panelContent">
</div></td>
</tr>
</table><table name="inputBox" cellspacing="0" cellpadding="0" id="inputBox" tabindex="400" class="SmartPanel" width="400" style="display:none;">
<tr>
<td id="inputBox_cap" class="SmartPanelC" valign="middle"><div class="sprite-icon control-icon" icon="Close" mode="c" style="float:right;">
<div class="control-icon-img control-Close">
</div>
</div>Copy to clipboard (Ctrl+C)</td>
</tr><tr>
<td class="SmartPanelCN" id="inputBox_cont" width="400" height="0"><table tabindex="400" border="0" width="100%">
<tr>
<td><input name="inputBox$ctl01" type="text" class="editor" /></td>
</tr><tr>
<td align="right"><button type="button" class="MessageButton Button">OK</button><button type="button" class="MessageButton Button">Cancel</button></td>
</tr>
</table></td>
</tr>
</table></form>
</body>
</html>
The query parameters, such as $filter, are separated from the path by ?. In your case that should give <base url>/BusinessAccount?$filter=<filter espression>.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace XEx02Quotation
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
if (IsValid)
{
int SalesPrice = Convert.ToInt32(TextBox1.Text);
// When a user inputs an integer, I want it to be able to handle input of fractions
// without getting an exception error.
// If a user inputs a whole number or fractional number (like 20.25), it should be able
// to handle it.
double DiscountPercentage = Convert.ToDouble(TextBox2.Text);
double discountValue = this.CalculateDiscountValue(SalesPrice, DiscountPercentage);
double TotalPrice = this.TotalPriceCalculate(SalesPrice, discountValue);
Label1.Text = discountValue.ToString("c");
Label2.Text = TotalPrice.ToString("c");
}
}
protected double CalculateDiscountValue(int SalesPrice, double DiscountPercentage)
{
double discountAmount = SalesPrice * DiscountPercentage;
return discountAmount;
}
protected double TotalPriceCalculate(int SalesPrice, double discountAmount)
{
double TotalPrice = SalesPrice - discountAmount;
return TotalPrice;
}
}
}
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="XEx02Quotation.Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Price quotation</title>
<style type="text/css">
.auto-style1 {
width: 54%;
height: 213px;
}
.auto-style15 {
width: 114px;
height: 23px;
}
.auto-style16 {
width: 114px;
}
.auto-style17 {
width: 114px;
height: 28px;
}
.auto-style18 {
width: 193px;
height: 23px;
}
.auto-style20 {
width: 193px;
height: 28px;
}
.auto-style21 {
width: 193px;
}
.auto-style22 {
margin-left: 12px;
}
.auto-style23 {
margin-left: 16px;
}
.auto-style25 {
width: 193px;
height: 5px;
}
.auto-style26 {
width: 114px;
height: 5px;
}
.auto-style27 {
width: 143px;
height: 23px;
}
.auto-style28 {
width: 143px;
height: 5px;
}
.auto-style29 {
width: 143px;
}
.auto-style30 {
width: 143px;
height: 28px;
}
.auto-style31 {
width: 143px;
height: 25px;
}
.auto-style32 {
width: 193px;
height: 25px;
}
.auto-style33 {
width: 114px;
height: 25px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<h1>Price quotation</h1>
<br />
<br />
<table class="auto-style1">
<tr>
<td class="auto-style27">Sales Price</td>
<td class="auto-style18">
<asp:TextBox ID="TextBox1" runat="server" CssClass="auto-style23" Width="173px" Font-Bold="True"></asp:TextBox>
</td>
<td class="auto-style15"></td>
</tr>
<tr>
<td class="auto-style27"></td>
<td class="auto-style18"></td>
<td class="auto-style15"></td>
</tr>
<tr>
<td class="auto-style27">Discount percent</td>
<td class="auto-style18">
<asp:TextBox ID="TextBox2" runat="server" CssClass="auto-style22" Width="169px"></asp:TextBox>
</td>
<td class="auto-style15"></td>
</tr>
<tr>
<td class="auto-style28">Discount amount</td>
<td class="auto-style25"> <asp:Label ID="Label1" runat="server" Font-Bold="True" Text="Label"></asp:Label>
</td>
<td class="auto-style26"></td>
</tr>
<tr>
<td class="auto-style27"></td>
<td class="auto-style18"></td>
<td class="auto-style15"></td>
</tr>
<tr>
<td class="auto-style30">Total price</td>
<td class="auto-style20">
<asp:Label ID="Label2" runat="server" Font-Bold="True" Text="Label"></asp:Label>
</td>
<td class="auto-style17"></td>
</tr>
<tr>
<td class="auto-style31">
</td>
<td class="auto-style32"></td>
<td class="auto-style33"></td>
</tr>
<tr>
<td class="auto-style29">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Calculate" Width="90px" />
</td>
<td class="auto-style21"> </td>
<td class="auto-style16"> </td>
</tr>
</table>
</form>
</body>
</html>
when I input the sales price in the textbox as a fraction (like 120.99) and enter an int number or double (like 15 or 20.2) into the discount percentage textbox, the discount amount and total price doesn't calculate right? Do I need to do explicit conversions with my variables? I am so confused. Here is code for ASP.NET web form in my web application. I am currently working within my Default.aspx.cs (C#) file (and I also have a Default.aspx file too).
As pointed out in the comments and in TaW's answer, you should be using decimal instead of int and the total price calculation misses division by 100. I have put everything together.
The click handler should be modified as follows:
protected void Button1_Click(object sender, EventArgs e)
{
if (IsValid)
{
decimal salesPrice;
decimal discount;
if (decimal.TryParse(TextBox1.Text, out salesPrice))
{
if (decimal.TryParse(TextBox2.Text, out discount))
{
decimal discountValue = this.CalculateDiscountValue(salesPrice, discount);
decimal totalPrice = this.TotalPriceCalculate(salesPrice, discount);
Label1.Text = discountValue.ToString("c");
Label2.Text = totalPrice.ToString("c");
}
}
}
}
And the helper methods as follows:
protected decimal CalculateDiscountValue(decimal salesPrice, decimal discountPercentage)
{
return salesPrice * discountPercentage / 100m;
}
protected decimal TotalPriceCalculate(decimal salesPrice, decimal discountAmount)
{
return salesPrice - discountAmount;
}
I have looked at:
The resizable control,
and this forum link,
all without finding the proper resolution.
I have a page (without a master page) that has 2 columns. Once column houses a menu structure, and the other a PDF viewer.
I want to be able to hide the menu, and expand the PDFviewer to the full page.
Unfortunately, I currently only have the Hide() option working.
Here is some code:
Style Sheet.css
body {
}
.wrapper {
margin: 0 auto;
}
.left {
width: 25%;
float: left;
background: #f4f4f4;
overflow: hidden;
}
.right {
width: 75%;
float: right;
margin-top: -20px;
padding-top: -20px;
}
Default.aspx
<div class="wrapper">
<div runat="server" id="left" class="left">
<div style="padding-top: 10px">
<asp:Label runat="server" Text="File List" Font-Size="20px" Font-Bold="True"></asp:Label>
- <a id="uploadLink" href="Upload.aspx">Upload</a>
<br />
<br />
<!-- Menu structure -->
</div>
</div>
<div class="right" id="right">
<a id="showh1">+</a>
<a id="hideh1">-</a>
<div style="border: 1px solid grey;">
<iframe runat="server" id="pdfHolder" width="100%" seamless="seamless" title="Doc"></iframe>
</div>
</div>
<asp:Label runat="server" ID="lbltest" Text=" ---- " Visible="False"></asp:Label>
</div>
Javascript snippet on Default.aspx
<script type="text/javascript">
$(document).ready(function () {
$('#hideh1').click(function () {
$('div.left').hide("Drop");
});
$('#showh1').click(function () {
$('div.left').show("Drop");
});
});
</script>
How can I correctly do this?
Try this:
<script type="text/javascript">
$(document).ready(function () {
$('#hideh1').click(function () {
$('div.left').hide("Drop");
$('div.right').css("width", "100%");
});
$('#showh1').click(function () {
$('div.left').show("Drop");
$('div.right').css("width", "75%");
});
});
</script>
I'm having a bit of an issue with an Ajax form. I've probably done it a bit backwards no doubt. Basically, when I hit the submit button in the form, nothing at all happens. I've debugged however it doesn't appear to post to the action method. It literally does nothing.
Here is my code so far:
Basically I post information from a form with the model of DetailedBreakdownReportRequest. This model is being passed through fine as my page displays the list of initial unfiltered results.
DetailedBreakdownReport Action Method:
[HttpPost]
public ActionResult DetailedBreakdownReport(DetailedBreakdownReportRequest reportRequest, FormCollection formVariables)
{
return View(reportRequest);
}
DetailedBreakdownReport View
<%# Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Main.Master" Inherits="System.Web.Mvc.ViewPage<MyApp.Data.AdvancedReports.AdvancedReports.DetailedBreakdownReports.DetailedBreakdownReportRequest>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Detailed Breakdown Report
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script language="javascript" type="text/javascript" src="<%= ResolveUrl("~/Scripts/jquery-1.4.1.min.js")%>"></script>
<script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="/Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
<% using (Ajax.BeginForm("DetailedList", "Reports",
new AjaxOptions
{
UpdateTargetId = "panelBreakdownList",
InsertionMode = InsertionMode.Replace
},
new { id = "SearchForm" })) %>
<% { %>
<div style="position: absolute; top: 0px; height: 30px; right: -12px; margin-top: 8px;
width: 250px; padding-left: 00px; vertical-align: middle; display: inline-block;">
<input id="searchField" name="searchField" style="padding-left: 5px; position: relative;
float: left; top: 3px; margin: 0px; border: 1px solid #DDDDDD; height: 19px;
width: 200px;" />
<%: Html.HiddenFor(m => m.ToDate) %>
<%: Html.HiddenFor(m => m.FromDate) %>
<%: Html.HiddenFor(m => m.Currency) %>
<%: Html.HiddenFor(m => m.ReportType) %>
<!--<input type="image" src="/Content/Images/search-form-submit.png" style="border: 0px;
height: 27px; position: relative; left: -8px; margin: 0x; float: left;" />-->
<input type="submit" value="Search" style="border: 0px;
height: 27px; position: relative; left: -8px; margin: 0x; float: left;" />
</div>
<% } %>
<div id="panelBreakdownList" style="position: relative; z-index: 0;">
<% Html.RenderAction("DetailedList", new { ToDate = Model.ToDate, FromDate = Model.FromDate, Currency = Model.Currency, ReportType = Model.ReportType }); %>
</div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Header" runat="server">
<h1>Detailed Breakdown Report</h1>
<h2><%: Model.ToDate.ToString("dd-MMM-yyyy") %> to <%: Model.FromDate.ToString("dd-MMM-yyyy")%></h2>
</asp:Content>
Here is the DetailedList action that is called from the above page, and it's view:
[HttpPost]
public ActionResult DetailedList(DateTime ToDate, DateTime FromDate, string Currency, string ReportType, FormCollection formVariables)
{
DetailedBreakdownReportRequest reportRequest = new DetailedBreakdownReportRequest()
{
ToDate = ToDate,
FromDate = FromDate,
Currency = Currency,
ReportType = ReportType,
UserId = UserServices.CurrentUserId
};
DrilldownReportEngine re = new DrilldownReportEngine();
DetailedBreakdownReport report = null;
if (formVariables.HasKeys())
{
reportRequest.searchTerm = formVariables["searchField"];
report = re.GetDetailedBreakdown(reportRequest);
}
else
{
report = re.GetDetailedBreakdown(reportRequest);
}
return PartialView(report);
}
<%# Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyApp.Data.AdvancedReports.AdvancedReports.DetailedBreakdownReports.DetailedBreakdownReport>" %>
<% if (Model.HasData)
{ %>
<% if (Model.ShopBreakdown != null)
{ %>
<h2>Shop Breakdown Report</h2>
<p>Click on a shop's name to see additional information.</p>
<div id="shopGrid" style="float:left; width: 400px;">
<table width="400px">
<% foreach (var shop in Model.ShopBreakdown)
{ %>
<tr>
<td colspan="3"><h2><%: Html.ActionLink(shop.Shop.Name + " >>", "ShopDashboard", new { ShopId = shop.Shop.ShopID, Currency = Model.Currency, toDate = Model.ToDate.ToString(), fromDate = Model.FromDate.ToString(), percentageOfSales = shop.RevenuePercentageOfSales })%></h2></td>
</tr>
<tr>
<td><p class="labels">Units Sold:</p></td>
<td><b style="font-size:larger;"><%: shop.UnitsSoldPerShop%></b></td>
<td rowspan="2" align="center"><h2><%: String.Format("{0:0.0%}", shop.RevenuePercentageOfSales)%></h2> of Total Revenue</td>
</tr>
<tr>
<td><p class="labels">Revenue Earned:</p></td>
<td><b style="font-size:larger;"><%: String.Format("{0:0.00}", shop.TotalRevenuePerShop)%></b></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<% } %>
</table>
</div>
<% } %>
<% if (Model.ProductBreakdown != null)
{ %>
<% foreach (var product in Model.ProductBreakdown)
{ %>
<div id="ProductGrid" style="float:left; width: 500px;">
<div>
<h3><%: Html.ActionLink(product.Product.Name + " >>", "ProductDashboard", new { ProductId = product.Product.ProductID, Currency = Model.Currency, toDate = Model.ToDate.ToString(), fromDate = Model.FromDate.ToString(), percentageOfSales = product.RevenuePercentageOfSales })%></h3>
</div>
<div style="float:left; width: 200px;">
<p class="labels">Units Sold: </p><b style="font-size:larger;"><%: product.TotalUnitsSoldPerProduct %></b>
<br />
<p class="labels">Revenue Earned: </p><b style="font-size:larger;"><%: String.Format("{0:0.00}", product.OverallTotalRevenuePerProduct)%></b>
</div>
<div style="float: left; text-align: center;">
<h2><%: String.Format("{0:0.0%}", product.RevenuePercentageOfSales)%></h2> of Total Revenue
</div>
</div>
<% } %>
<div style="clear:both;" />
<br />
<% } %>
<% } %>
As I said above, on first load, the page displays fine, it displays an unfiltered view of the results. When I type in a value into the text box and click submit, nothing at all happens and I'm finding that hard to debug. At least if it did something I'd have something to work with. Can anyone see if I'm doing something wrong here?
As I see, you expect some not nullable variables in action detailedList which are expected from form.
[HttpPost]
public ActionResult DetailedList(DateTime ToDate, DateTime FromDate, string Currency, string ReportType, FormCollection formVariables)
{
......
}
But you just send searchfield in form collection. Where is the ToDate, FromDate, Currency variables in form?
I think you should create a formmodel forexample
DetailedListSearchModel
DateTime ToDate
DateTime FromDate
string Currency
string ReportType
string Searchfield
and make search a partialview. Just pass default values when partial view is rendered with default values then execute in form.
Then you will take this values in action like
[HttpPost]
public ActionResult DetailedList(DetailedListSearchModel model)
{
......
}
You can use this model in form like
<%= Html.LabelFor(m => m.Searchfield) %>
<%= Html.TextBoxFor(m => m.Searchfield, new { #class = "css classes", maxlength = "1000" })%>
<%= Html.ValidationMessageFor(m => m.Searchfield) %>
$(function() {
$('form#SearchForm').find('a.submit-link').click( function() {
$('form#SearchForm').trigger('submit');
}).show();
}
and change search button to a.
Search