Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make web parts that can be rendered as static

Status
Not open for further replies.

GuitarMike

Programmer
Jul 27, 2004
2
US
I've successfully made some web parts in visual studio and deployed them with a cab file and I've used the strongly named assemblies. Now I need to display my web part (the hello world web part at this point) outside of a web part zone. I want to add the web part as a control on the default.aspx page. When I do this, I get an error: 'External component has thrown an exception.'

The code of my web part is as follows:
output.Write(SPEncode.HtmlEncode("Hello World!"));

The webpart works when i drag and drop it onto a page. When I use the following snippet in my default.aspx however, I get the error.

at top:
<%@ Register Tagprefix="INGBC" Assembly="BreadCrumbs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=48c44aa74f9e952b" Namespace="BreadCrumbs" %>

in the page:
<INGBC:BreadCrumbsPart runat="server" id="BreadCrumbsPart" />

I believe I have the namespace/assembly names etc. correct because if I change them, I get other errors like the assembly cannot be found. So, I'm not sure what's wrong at this point. Any help here would be great.

Thanks in advance!

Mike

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top