Archive for the 'ASP.NET' Category

04 Feb

Solution: Invalid FORMATETC structure

I was making a ASP.NET components library and when I was ready with my library I made a Web Application project and started dragging and dropping to them my form.
To my surprise, I was not able to do so and I got following error.
The operation could not be completed. Invalid FORMATETC structure
Many of you [...]

01 Dec

Collection was modified; enumeration operation may not execute

Collection was modified; enumeration operation may not execute
This exception is thrown when you are trying to delete items of a collection in a for loop or using a for each loop.
The ideal solution could be to use a for loop with a descending counter.
Problem:
for e.g.
If suppose you are executing any of following code snippets
1.
for [...]

25 Jun

ASP.NET Dynamic controls: Twice click problem

Sometimes, you need to click twice for the dynamic control to work.
Symptoms:
1. Your dynamic controls get loaded
2. You click on the button/other control
3. The page simply refreshes and no code is executed.
4. You try to debug the “onclick” method, but no break point is hit.
5. Next time when you hit the button, everything works properly.
Solution:
After [...]