Author: Yisman | Posted on: 11/1/2010 4:18:10 AM | Views : 317

hello friends!
ive asked this question here http://stackoverflow.com/questions/3967333/removing-specific-routes-from-asp-net-4-routestable but have not yet recieved a workable solution
the problem is that i need to remove only specific routes from the routetable and then add them back (with some changes). I do not want to clear the whole collection.

heres my code

For Each r In RouteTable.Routes
If CType(r, Route).DataTokens("ConfigID") = ConfigID Then RouteTable.Routes.Remove(r)
Next
the problem is, as soon as the first route is removed, the following error is thrown:
Collection was modified; enumeration operation may not execute
so how can i get around this error? or is there a better way to remove routes?


Thank you very very much for your time and help!

...

Go to the complete details ...