Click here to Skip to main content
15,903,385 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a modalpopupextender. after I selected the gridview and when the value of the textbox is installment, it will compute the values and show it to the txtInsAmount. Then the Value in the txtInsAmount must be the same as txtAmount. But it isn't working. Here are the codes.

C#
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        //txtInsAmount.Text = Server.HtmlEncode(txtAmount.Text);
        txtOID.Text = GridView1.SelectedRow.Cells[2].Text;
        txtCName.Text = GridView1.SelectedRow.Cells[1].Text;
        txtTAP.Text = GridView1.SelectedRow.Cells[4].Text;
        txtRBalance.Text = GridView1.SelectedRow.Cells[5].Text;
        txtMoP.Text = GridView1.SelectedRow.Cells[7].Text;
        if (txtMoP.Text == "Installment")
        {
            decimal a = Convert.ToDecimal(txtRBalance.Text);
            decimal b = Convert.ToDecimal(2);

            Label7.Visible = true;
            txtInsAmount.Visible = true;
            txtInsAmount.Text = (a / 2).ToString();
            txtInsAmount.Text = Server.HtmlEncode(txtAmount.Text);
    }


txtInsAmount.Text = Server.HtmlEncode(txtAmount.Text);
Maybe there is something wrong in this code? Thank you!
Posted
Updated 20-Feb-14 3:56am
v3

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