0

Hello everybody!

I have encountered a problem and I didn't manage to find any soultions yet. Let me simplify things a bit.

I have 2 forms, the first contains an ASP ListBox with multi select mode enabled. I submit the form and in the other form I use just for testing purposes this snippet of code:

protected void Page_Load(object sender, EventArgs e)
        {
            foreach (string formKey in Request.Form.AllKeys)
            {
                if (formKey != null)
                {
                    if (formKey.Equals("ctl00$MainContent$ListBox1"))
                        Label1.Text = Request.Form[formKey];
                }
            }  
        }

The problems is that the values that come from the listbox (the values that i selected in the previous form) are separated by "," for ex. "test1,test2,test3". How can i change this separator to "$" for example? I need to change it because the actual values may contain "," and i don't manualy feed them to the listbox.

I can't use any other mode of transfering this values between the form because the entire application uses this model. The values that i get are then sent to a workflow where there will be manipulated and in the workflow i need to know where each listbox item starts and ends so it must be an unique separator.

Any help is apreciated! Thank you very much

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by flaviu_xdv
0

Can't you simply do a string replace() on the resulting string to get the separator character you want?

0

Yes but this will also replace the intended "," if there is any in the actual values, so it must be something else done before the values are sent.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.