B
Bob M
If I define an expression or equation, how can I retrieve that expression as
string literal? I want to do this so that I could avoid repetitive typing
(or copy/paste/change) the same thing at two place. I try to demonstrate
the problem in the following code.
Bob M
<%@ Page Language="C#" %>
<script runat="server">
public static double givenFn(double x) {
return (Math.Pow(x, 3) + (3 * Math.Pow(x, 2)) - (10 * x));
}
protected void Page_Load(object sender, EventArgs e) {
Label1.Text = "The given function is: " + "Math.Pow(x, 3) + (3 *
Math.Pow(x, 2)) - (10 * x)";
}
</script>
<html>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
string literal? I want to do this so that I could avoid repetitive typing
(or copy/paste/change) the same thing at two place. I try to demonstrate
the problem in the following code.
Bob M
<%@ Page Language="C#" %>
<script runat="server">
public static double givenFn(double x) {
return (Math.Pow(x, 3) + (3 * Math.Pow(x, 2)) - (10 * x));
}
protected void Page_Load(object sender, EventArgs e) {
Label1.Text = "The given function is: " + "Math.Pow(x, 3) + (3 *
Math.Pow(x, 2)) - (10 * x)";
}
</script>
<html>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>