Neeraj Raveendran
Neeraj Raveendran

Reputation: 23

pass String value to a Double quotes

hi i am using Javascript Dynamic Textbox for my application now want to get the value too my DB.

Please look in this code, I am Using HTML input for dynamic textbox

    string k = HiddenField1.Value;
    int j = Convert.ToInt32(k);

    for (int i = 1; i <= j; i++)
    {



        if (Page.IsPostBack)
        {
            string name = "txtName" + j.ToString();

            string Namevalue = Page.Request.Form["\"name\""].ToString();

            string PPT = "txtPPT" + j.ToString();
            string PPTvalue = Page.Request.Form["PPT"].ToString();

            string Age = "NA";

i want to pass the value name toPage.Request.Form["\"name\""].ToString();

Please help I am new to .net

Upvotes: 0

Views: 805

Answers (1)

Grundy
Grundy

Reputation: 13380

I think you need use

string Namevalue = Page.Request.Form[name].ToString();

instead of

string Namevalue = Page.Request.Form["\"name\""].ToString();

and same with PPT

string PPTvalue = Page.Request.Form[PPT].ToString();

instead of

string PPTvalue = Page.Request.Form["PPT"].ToString();

because your string variables name and PPT contains value what you need

Upvotes: 2

Related Questions