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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 15, 2013, 10:45 PM EDT
i attached a sample just check that once.
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 15, 2013, 9:58 PM EDT
samantaRank #3,157 · 454 reputationPosted Jul 15, 2013, 10:00 PM EDT
on click on button i want result in another textbox
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 15, 2013, 10:09 PM EDT
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
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 15, 2013, 10:14 PM EDT
You like to evaluate the Arithmatic expression in your second textbox?
Regards,
Iftikar
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 15, 2013, 10:24 PM EDT
Regards,
Iftikar
samantaRank #3,157 · 454 reputationPosted Jul 15, 2013, 10:27 PM EDT
code must be in asp.net c# web app
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 15, 2013, 10:31 PM EDT
Regards,
Iftikar
samantaRank #3,157 · 454 reputationPosted Jul 15, 2013, 10:37 PM EDT
code must works for any type of Arithmatic expression
samantaRank #3,157 · 454 reputationPosted Jul 16, 2013, 12:27 AM EDT
its giving error as namespace Ncalc could not found
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 16, 2013, 12:32 AM EDT
samantaRank #3,157 · 454 reputationPosted Jul 16, 2013, 12:34 AM EDT
i want that code how can i see them
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 16, 2013, 12:41 AM EDT
its a dll from codeplex the provider didn't provide the source code. its only for use.
samantaRank #3,157 · 454 reputationPosted Jul 16, 2013, 1:07 AM EDT
VulpesRank #55 · 29.2K reputationPosted Jul 16, 2013, 1:55 AM EDT
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";
}
}
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 16, 2013, 2:05 AM EDT
i finally found the source code of ncalc. i am attaching the source code just check that.
samantaRank #3,157 · 454 reputationPosted Jul 16, 2013, 2:14 AM EDT
samantaRank #3,157 · 454 reputationPosted Jul 16, 2013, 2:15 AM EDT
without using script and only using c# web app we cant write code for that
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 16, 2013, 2:16 AM EDT
mark it as answered if its help you. so it will helpfull for others.
samantaRank #3,157 · 454 reputationPosted Jul 16, 2013, 2:18 AM EDT