Scenario:
My friend called me again this morning and mentioned me that code which I blogged in this article have some issues. Well, that not new :-) .
Basically SPLimitedWepPartManager.Webparts was returning ErrorWebPart inspite of returning correct WebPart type.
Solution:
I tried analyzing the issue and found a weird solution.
Observation 1: There were some Custom webparts on the page , and the binaries for the same was in BIN
Fix 1 : Move the binaries to GAC ( this should make it work mostly )
still it didn't fix for him.
Observation 2: Code he was executing was in a Console Application/ Win Application.
Fix 2 : Move the code into a layout page. ( this one fixed the issue )
Learned something new today :-)
Wednesday, January 7, 2009
Subscribe to:
Post Comments (Atom)
2 comments:
Your GAC solution helped me fix this issue while running a PowerShell script. Thanks!
Hello Sandeep,
How can I get the ErrorWebPart Name or Title programmatically? Pls help me.
Pls send your solution to
sridhar529@yahoo.co.in
-Sridhar
Post a Comment