forum

Home / DeveloperSection / Forums / request in retrieving values from input type textbox

request in retrieving values from input type textbox

Anonymous User 1531 27-Nov-2014
having a problem in retrieving the values input at the input type. here is the code that we use... 
protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        Session.Remove("clicks");
        i = 0;
    }
}
protected void GridView1_SelectedIndexChanged(object sender,EventArgs e)
{
    int rowCount = 0;
 
    rowCount =Convert.ToInt32(Session["clicks"]);
 
    rowCount++; 
    Session["clicks"] = rowCount;
 
    Literal1.Text =Literal1.Text + "PRODUCT: <input type='textbox' runat='server' id='textboxu" + i + "' value='" + GridView1.SelectedRow.Cells[1].Text + "' ></input> PRICE: <input type='textbox' runat='server' size='1' id='textboxe" + i + "' value='" + GridView1.SelectedRow.Cells[2].Text + "' ></input>QUANTITY:<input type='textbox' runat='server' size='1' id='textboxq" + i + "'></input>TOTAL:<input type='textbox' runat='server' size='3' id='total" + i + "' ></input><br>";
        i++;
}
protected void Button1_Click(object sender, EventArgs e)
{
    for (int check =0; check <= i; check++)
    {
        double price =Convert.ToDouble(this.Request.Form["textboxe" + i + ".Value"]);
        double quantity = Convert.ToDouble(this.Request.Form["textboxq" + i + ".Value"]);
        double total =price * quantity;
        TextBox1.Text= Convert.ToString(total);
        //this.Request.Form["total" + i] = Convert.ToString(total);
    }
}

we need to retrieve the answer also from the input type. i hope there are someone who will be willing to help us...


Updated on 27-Nov-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By