In my Project i have 2 textboxes.
In first textbox i want Arithmatic expression like
example:
(2+4)*3(3*5)+4
4+(5*7)%6(3+6)
In secand textbox i want result
Loading
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.
Sanjeeb LenkaPosted Jul 16, 2013, 2:45 AM
i attached a sample just check that once.
samantaPosted Jul 16, 2013, 6:18 AM
Sanjeeb LenkaPosted Jul 16, 2013, 6:16 AM
mark it as answered if its help you. so it will helpfull for others.
samantaPosted Jul 16, 2013, 6:15 AM
without using script and only using c# web app we cant write code for that
samantaPosted Jul 16, 2013, 6:14 AM
Sanjeeb LenkaPosted Jul 16, 2013, 6:05 AM
i finally found the source code of ncalc. i am attaching the source code just check that.
VulpesPosted Jul 16, 2013, 5:55 AM
First add a reference to your project to the Microsoft Script Control 1.0 which can be found under the COM tab.
The code to use it will then be on the following lines:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
var sc = new MSScriptControl.ScriptControl();
sc.Language = "JScript";
Session["ScriptControl"] = sc;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
var sc = Session["ScriptControl"] as MSScriptControl.ScriptControl;
try
{
TextBox2.Text = sc.Eval(TextBox1.Text).ToString();
}
catch
{
TextBox2.Text = "INVALID FORMULA";
}
}
samantaPosted Jul 16, 2013, 5:07 AM
Sanjeeb LenkaPosted Jul 16, 2013, 4:41 AM
its a dll from codeplex the provider didn't provide the source code. its only for use.
samantaPosted Jul 16, 2013, 4:34 AM
i want that code how can i see them
Sanjeeb LenkaPosted Jul 16, 2013, 4:32 AM
samantaPosted Jul 16, 2013, 4:27 AM
its giving error as namespace Ncalc could not found
samantaPosted Jul 16, 2013, 2:37 AM
code must works for any type of Arithmatic expression
Iftikar HussainPosted Jul 16, 2013, 2:31 AM
Regards,
Iftikar
samantaPosted Jul 16, 2013, 2:27 AM
code must be in asp.net c# web app
Iftikar HussainPosted Jul 16, 2013, 2:24 AM
Regards,
Iftikar
Iftikar HussainPosted Jul 16, 2013, 2:14 AM
You like to evaluate the Arithmatic expression in your second textbox?
Regards,
Iftikar
Sanjeeb LenkaPosted Jul 16, 2013, 2:09 AM
here i provide a link to a dll. just download it and use for your requirement . demos are there.
http://ncalc.codeplex.com/
if any problem reply
samantaPosted Jul 16, 2013, 2:00 AM
on click on button i want result in another textbox
Sanjeeb LenkaPosted Jul 16, 2013, 1:58 AM