Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have designing in my web page i have enter first text box some value. and secound text box enter some value.ok the two value are multiple near third text box ?
How to implement the code can u post the code i am beginner
Posted
Comments
DaveAuld 10-Jun-11 6:26am    
Well that depends on if you are performing the multiplication at the client side using javascript, or at the server in the codebehind using c#, vb.net etc.
raju melveetilpurayil 10-Jun-11 6:38am    
do not ask code. google is your friend, don't forget that.

Start here[^].
 
Share this answer
 
Comments
thatraja 10-Jun-11 8:16am    
Counter 5!
In .aspx page,

XML
<asp:TextBox ID="txtValue1" runat="server"></asp:TextBox>
                <asp:TextBox ID="txtValue2" runat="server"></asp:TextBox>
                <asp:Button ID="btnMultiply" runat="server" Text="Multiply" OnClick="btnMultiply_Click" />
                <asp:TextBox ID="txtAnswer" runat="server" ReadOnly="true" Style="background-color: Gainsboro"></asp:TextBox>




In .aspx.cs page,

C#
protected void btnMultiply_Click(object sender, EventArgs e)
    {
        if (txtValue1.Text == string.Empty || txtValue2.Text == string.Empty)
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Enter values in two textboxes')", true);
        else
        {
            int value1 = Convert.ToInt32(txtValue1.Text);
            int value2 = Convert.ToInt32(txtValue2.Text);
            txtAnswer.Text = Convert.ToString(value1 * value2);
        }
    }



...........
@Nidhish
 
Share this answer
 
C#
double firstValue = Convert.ToDouble(TextBox1.Text);
        double secondValue = Convert.ToDouble(TextBox2.Text);
        double total = firstValue * secondValue;
        TextBox3.Text = total.ToString();



Use it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900