Problem Accessing Dynamicially created HTML Control in Code Behind

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Himanshu

    Problem Accessing Dynamicially created HTML Control in Code Behind

    Hi,
    I have created a table in my webform and in that table i am
    creating/assigning dynamic HTML.
    I have added few control e.g strInnerHtml.Ap pend("<td><inpu t runat='server'
    type='text' Class='HomeCont ent' MaxLength='100' width = '100%' value
    ='"+oDSGetCustC ontract.Tables[0].Rows[intCounter]["ORG_CONTRACT_N UM"].ToString()+"' id='txtOriginal ContractNumber" +intCounter+"' ></td>");
    My Problem is that they get rendered and displayed appropriately but when i
    try to access them on click of Button using Request.Form("" ) they does not
    appear.I have checked request.form.co unt as well and they do not appear in it
    as well.
    Please somebody tell me why the controls do not appear in request.form and
    is there any method to access them.

    regards
    Himanshu
  • bruce barker

    #2
    Re: Problem Accessing Dynamicially created HTML Control in Code Behind

    for an <input> to post back, it must have a name attribute, as the postback
    is the name/value pair.

    -- bruce (sqlwork.com)


    "Himanshu" <Himanshu@discu ssions.microsof t.com> wrote in message
    news:43F71CED-820E-4773-9DAD-69F36E403ED8@mi crosoft.com...[color=blue]
    > Hi,
    > I have created a table in my webform and in that table i am
    > creating/assigning dynamic HTML.
    > I have added few control e.g strInnerHtml.Ap pend("<td><inpu t[/color]
    runat='server'[color=blue]
    > type='text' Class='HomeCont ent' MaxLength='100' width = '100%' value
    >[/color]
    ='"+oDSGetCustC ontract.Tables[0].Rows[intCounter]["ORG_CONTRACT_N UM"].ToStri
    ng()+"' id='txtOriginal ContractNumber" +intCounter+"' ></td>");[color=blue]
    > My Problem is that they get rendered and displayed appropriately but when[/color]
    i[color=blue]
    > try to access them on click of Button using Request.Form("" ) they does not
    > appear.I have checked request.form.co unt as well and they do not appear in[/color]
    it[color=blue]
    > as well.
    > Please somebody tell me why the controls do not appear in request.form and
    > is there any method to access them.
    >
    > regards
    > Himanshu[/color]


    Comment

    Working...