I am trying to populate selected values from a drop-down list into URL params. I have the below code, which is supposed to remove the trailing comma from the end of the URL, but it does not seem to be working. Does anyone see anything obviously incorrect?
Thanks in advance.
----------
if (lbxWFTemplate.Visible ==true)
{
strURL +="WFTemplate=";
foreach (ListItem liWFTemplatein lbxWFTemplate.Items)
{
if (liWFTemplate.Selected)
{
strURL += liWFTemplate.Value.ToString() +",";
}
}
strURL.TrimEnd(",".ToCharArray());I actually figured this out right after I posted. Trimend() returns a string, so the following was changed, and the code works as expected now:strURL = strURL.TrimEnd(",".ToCharArray());
0 comments:
Post a Comment