OK, that makes more sense. I don't get why in India, they call it a 'trainee' when they get someone in, don't pay them, and don't train them, and hope we'll do it for them. It's disgraceful.
You should read through my comments, this code is still excrable, and not production quality. Of course, you've not changed it, you took 11 minutes ( I waited while you edited to help you before going to bed ), and just added the comment that you'd fixed the code, and a new code snippet.
Minaxi Sajwan wrote:
txtmyarray.Text = (string)((Array)Session["myarray"])[0]
This has a whole new session value, unrelated to the two you posted before. If it works, then the code you posted is unrelated to it, as the first code stores an object that is not a string in the 0 index of the array, and under a different value.
It looks like you're working in a sheltered workshop, if you read and work through the things I said, you'll probably take a few days to be a better programmer than the clowns who wrote the code you're working on. Or, if you wrote all this code yourself, i guess you'll learn why all the code you wrote is terrible, and learn how to write something half decent.