|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
WebPartManager1.CloseWebPart Errorand CatalogZone on the page. The WebPartZone looks like this <ZoneTemplate> <uc1:DDEstimate ID="DDEstimate1" title="Estimate" runat="server" /> <uc2:DDStationVendor ID="DDStationVendor1" title="Vendor Summary" runat="server" /> <uc3:DDEstimateLog ID="DDEstimateLog1" title="Estimate Status Log" runat="server" /> <uc5:DDEmailToDownloadAlert ID="DDEmailToDownloadAlert1" title="Traffic Manager Alerts" runat="server" /> </ZoneTemplate> I am trying to use the code: WebPartManager1.CloseWebPart(DDEmailToDownloadAlert1) 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 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(DDEmailToDownloadAlert1.Parent, GenericWebPart)) Hope this helps. Please feel free to post here if anything is unclear. Regards, Walter Wang (waw***@online.microsoft.com, 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. 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 (waw***@online.microsoft.com, 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.
Setting Properties in a Composite Control...
Repeater and text boxes inside how to change labelvalue when deleting row in gridview? Programmatically listening for an event? Multi-line textbox scrolled to bottom? Problem handling event in a button inside a Datalist Can't install iewebcontrols.msi - error "webctrl_client is unavailable" passing variable to sql statement in asp.net 2.0? menu control with XML file Menu control and hover text color |
|||||||||||||||||||||||