D
Doogie
I have a .net app that a user currently enters a number in a text box,
hits a button and a data call is executed. She wants the ability to
enter in multiple numbers (up to 100).
So to make things look better visually for that, I created a listbox
under the text box. She enters the number in the text box, clicks
another button I added and the number is stored in the list box. Then
my plan was to grab all those numbers from the list box when she
clicks the original button to do the data call.
Here's my problem. I filled the listbox using java script - to
prevent hitting the server every time the user clicks my "add"
button. The listbox however is a server side lisbox. But, the moment
I hit my original button (i.e."Run Report"), the data goes away in the
listbox. I have tried to use the EnableViewState property and that
doesn't work. I've tried using the AutoPostBack property and that
doesn't work.
I was told the issue is that the only thing retained in the list box
is the item selected. So I tried to write a javascript method that
would select all of them when the user clicks the "Run Report"
button. It doesn't work, because I have to register the javascript
code in my code behind and it clears that listbox before it executes
even one line of code in the codebehind.
I tried to create a hidden text box to just store the numbers too and
that didn't work. I can't use a <input> with a type of hidden cause
that is a client control and I need this data on the server side. I
tried to just create a asp text box and make it's visible property
false, but then I can't access the text box on the client side when I
want to fill it.
I think I'm resigned to using a multi-line textbox to just let the
user enter them in all at once, but I hate the idea because it leads
the user down a path of potentially making many mistakes as he/she
enters. I just can't believe that their is no way to keep this data.
What am I missing?
hits a button and a data call is executed. She wants the ability to
enter in multiple numbers (up to 100).
So to make things look better visually for that, I created a listbox
under the text box. She enters the number in the text box, clicks
another button I added and the number is stored in the list box. Then
my plan was to grab all those numbers from the list box when she
clicks the original button to do the data call.
Here's my problem. I filled the listbox using java script - to
prevent hitting the server every time the user clicks my "add"
button. The listbox however is a server side lisbox. But, the moment
I hit my original button (i.e."Run Report"), the data goes away in the
listbox. I have tried to use the EnableViewState property and that
doesn't work. I've tried using the AutoPostBack property and that
doesn't work.
I was told the issue is that the only thing retained in the list box
is the item selected. So I tried to write a javascript method that
would select all of them when the user clicks the "Run Report"
button. It doesn't work, because I have to register the javascript
code in my code behind and it clears that listbox before it executes
even one line of code in the codebehind.
I tried to create a hidden text box to just store the numbers too and
that didn't work. I can't use a <input> with a type of hidden cause
that is a client control and I need this data on the server side. I
tried to just create a asp text box and make it's visible property
false, but then I can't access the text box on the client side when I
want to fill it.
I think I'm resigned to using a multi-line textbox to just let the
user enter them in all at once, but I hate the idea because it leads
the user down a path of potentially making many mistakes as he/she
enters. I just can't believe that their is no way to keep this data.
What am I missing?