List box Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mvmashraf
    New Member
    • Oct 2007
    • 36

    List box Problem

    Hai To all

    i have a list box and one text box, if the user enter a name in to the text box then press submit the name is added to the list box, if the user not enter the name in the text box and click submit the name addded as "noname",He re the tricky part what we need,if the user first submit without enter name the "noname" is added on the same process on next time we need to add as "noname1",n ext "noname2"...... ......(eg:if we add a new folder with our name in the drine new folder1,newfold er2............ ....etc)

    Any suggetion will be appreciatable

    By Ashraf
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Originally posted by mvmashraf
    Hai To all

    i have a list box and one text box, if the user enter a name in to the text box then press submit the name is added to the list box, if the user not enter the name in the text box and click submit the name addded as "noname",He re the tricky part what we need,if the user first submit without enter name the "noname" is added on the same process on next time we need to add as "noname1",n ext "noname2"...... ......(eg:if we add a new folder with our name in the drine new folder1,newfold er2............ ....etc)

    Any suggetion will be appreciatable

    By Ashraf

    In the On Click event handler for your button that submits, create a variable that remembers how many times the user has submitted an empty string.
    Append that number to the string that you are adding to the listbox.

    If you are developing a web application you're going to need to store this value somehow...I recommend view state or session or even cookies if you really want to.

    Comment

    Working...