User1040369262 posted
What kind technology do I need use based dynamic statement in ASP.net with C#?
I hope the end user input dynamic statement with C# in TextBox1
For example1
int i = 5;
int j = 6;
int result = i * j - 2;
For example2
double d1 = 23.6;
double d2= 52.3;
double result=1.0;
for (int i = 1; i <= 2; i++)
{
result = result * d1 * d2;
}
then the result will be displayed when the user click Button1, how can do that? Thanks!
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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 runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Input
<br />
<asp:TextBox ID="TextBox1" runat="server" Height="120px" TextMode="MultiLine" Width="192px"></asp:TextBox>
<br />
<asp:Button ID="Button1" runat="server" Text="Get Result" /></div>
</form>
</body>
</html>