hi Friends,
I am substracting two dynamic parameters like this
but getting view page error,input string not in corect format.
how to do this?
hi Friends,
I am substracting two dynamic parameters like this
but getting view page error,input string not in corect format.
how to do this?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh KumarPosted Jun 28, 2022, 1:01 PM
Sachin SinghPosted Jun 28, 2022, 12:16 PM
Your code should be like below
@{
var totnet = 0;
}
@foreach (var item in (ViewBag.data))
{
if (item.Name=="")
{
// do something
}
else if (item.StoreName == "abc")
{
totnet = Convert.ToDecimal(@item.TotalPriceWithTax) - Convert.ToDecimal(@item.Return);
}
@totnet
}
prasanna pPosted Jun 28, 2022, 11:18 AM
not getting please once check this
@foreach (var item in (ViewBag.data))
{
else if (@item.StoreName == "abc")
{
var totnet = Convert.ToDecimal(@item.TotalPriceWithTax) - Convert.ToDecimal(@item.Return);
}
@totnet
}
Sachin SinghPosted Jun 28, 2022, 11:07 AM
prasanna pPosted Jun 28, 2022, 11:04 AM
Getting
@{
Convert.ToDecimal(item.TotalPrice)-Convert.ToDecimal(item.Return)
}
; expected error in the line 2 end
Sachin SinghPosted Jun 28, 2022, 10:58 AM