Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > WebPartManager1.CloseWebPart Error

Reply
Thread Tools

WebPartManager1.CloseWebPart Error

 
 
Jerry C
Guest
Posts: n/a
 
      07-13-2006
I am trying to close a webpart in a WebPartZone. There is a WebPartManager
and CatalogZone on the page.
The WebPartZone looks like this

<ZoneTemplate>
<uc1DEstimate ID="DDEstimate1"
title="Estimate" runat="server" />
<uc2DStationVendor ID="DDStationVendor1"
title="Vendor Summary" runat="server" />
<uc3DEstimateLog ID="DDEstimateLog1"
title="Estimate Status Log" runat="server" />
<uc5DEmailToDownloadAlert
ID="DDEmailToDownloadAlert1" title="Traffic Manager Alerts" runat="server" />


</ZoneTemplate>


I am trying to use the code:
WebPartManager1.CloseWebPart(DDEmailToDownloadAler t1)
to close the webpart and getting the error:
Error 10 Value of type 'ASP.ddemailtodownloadalert_ascx' cannot be converted
to 'System.Web.UI.WebControls.WebParts.WebPart'.

Thank you





--
Jerry
 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      07-14-2006
Hi Jerry,

When using User Control or Server Control as WebPart, they will be wrapped
with GenericWebPart, which can be referenced by the control's Parent
property:

WebPartManager1.CloseWebPart(CType(DDEmailToDownlo adAlert1.Parent,
GenericWebPart))

Hope this helps. Please feel free to post here if anything is unclear.

Regards,
Walter Wang ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      07-18-2006
Hi Jerry,

I am interested in this issue. Would you mind letting me know the result of
the suggestions? If you need further assistance, feel free to let me know.
I will be more than happy to be of assistance.

Have a great day!

Regards,
Walter Wang ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xffc Thread 0x228 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-30-2006 03:16 PM
Error connecting to SQLExpress 2005 locally (error: 26 - Error Locating Server/Instance Specified) hfk0 ASP .Net 2 03-27-2006 08:43 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 1 03-24-2006 04:20 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-24-2006 02:22 PM
Error 500: ERROR: Cannot forward. Writer or Stream already obtained. Error JavaQueries Java 1 03-01-2005 06:30 PM



Advertisments