user2162570
user2162570

Reputation: 71

Calculating with a hidden number

Design:

ComboBox1__txtBox1__txtBox2___txtBox3

When you select a name in comboBox1 a number is called with DataBinding in txtBox1 and txtBox2.

double a1 = Convert.ToDouble(textBox1.Text);
double b1 = Convert.ToDouble(textBox2.Text);

textBox3.Text = (a1 * b1).ToString();

How can I make this so that the textBox2 wouldn't be seen in the design. If I set textBox2 Properties Visible to false I get an error.

Upvotes: 0

Views: 96

Answers (1)

PM_ME_YOUR_CODE
PM_ME_YOUR_CODE

Reputation: 321

Try to use this.

<asp:HiddenField id="InvisibleField" runat="server" />

Assign the result of (a1 * b1).ToString(); to "InvisibleField".

Upvotes: 1

Related Questions