Controlling the html

Discussion in 'ASP .Net' started by Andy Sutorius via DotNetMonster.com, Jun 7, 2005.

  1. Hi,

    The datagrid auto generates html for everything in the grid, including
    controls. Can you manipulate the html the grid outputs? Can you make this
    auto generated name for a text box, dgdANSI835:_ctl2:type, into this
    manipulated name for the text box, type_119789 (where 119789 represents a
    unique row number)?

    Thanks,

    Andy
     
    Andy Sutorius via DotNetMonster.com, Jun 7, 2005
    #1
    1. Advertisements

  2. Andy Sutorius via DotNetMonster.com

    Brock Allen Guest

    Sure, but you'll have to use a TemplateColumn. In the TemplateColumn where
    you declare the <asp:TextBox> just give it whatever ID="XYZ" you prefer.
    The only problem is that it is contained inside of other controls, so the
    ID that it will end up with in the broswer will be prefixed/scoped with the
    container controls.

    I suspect you're trying to do something specific here... Can you shed some
    light on what you're trying to accomplish?
     
    Brock Allen, Jun 8, 2005
    #2
    1. Advertisements

  3. I want to compare the values from the textbox against the original data in
    order to generate an update sql statement. I am trying to get the name of
    the textbox to match the column name of the original data.

     
    Andy Sutorius via DotNetMonster.com, Jun 8, 2005
    #3
  4. Andy Sutorius via DotNetMonster.com

    Guest Guest

    As far as I am aware you cannot. But once you understand the naming scheme it
    is fairly easy to interact with them:

    [containername](unless on parent form)__[controlname]__ctl[rowNum (1
    based)]__ctl[columnNum(0 based)]

    Also if you're using NUnitASP you can interact with them more directly,
    please reply if you want me to expand on that.

    Jason L Lind
    Senior Software Engineer - Triton Tek
     
    Guest, Jun 8, 2005
    #4
  5. Andy Sutorius via DotNetMonster.com

    Shimon Sim Guest

    I didn't work with DataSet for a while. But look into DataGrid binding and
    wording with dataset.
    Shimon.

     
    Shimon Sim, Jun 8, 2005
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.