Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

asp.net 1.1 + unique pblm + datatable + textbox

Back to Forum: Tech Off
  • User profile image
    munchy_cool

    hi there,
    i am wrkn on asp.net 1.1 and i have a unique kinda pblm,
    i have some values stored in a database,now i am getting some of the selected values based on a query into a datatable,

    now wht i want is to print dese values whch are in the datatable into the form in a textbox for editing purposes,
    how do i do dat and one thng to be kept in mind isthe number of values may vary so i may need diff num f textboxes everytime,

    how to dynamically generate textboxes wid diff id's depending on the number of values in the datatable?

    plz provide me with code..

    thx

    regards,
    munchy

  • User profile image
    msk

    to do what you are asking
    requires you to have a link stored in a persistant
    place either in the control veiwstate or session state

    which links each control id to the record you wish to update.


    on Form Init
    NOT Form Load it wil not be persistant


    TextBox T = new TextBox();

    T.name = \\Generate unique one;


    // if you want to set the update data
    T.Attributes.Add("Tag", "Field link");

    this.Controls.Add(T);


    // to get the values
    //
    ControlType = this.Controls[i].GetType().ToString();

    if (ControlType == "System.Web.UI.WebControls.TextBox")
    {

    }

  • User profile image
    stevo_

    If your going to ask people to do all the work for you, you could at least try and not come across as an utter cretin.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.