p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional Web Parts and Custom Controls ASP.NET ISBN: 0-7645-7860-X (http://p2p.wrox.com/forumdisplay.php?f=225)
-   -   WebParts not working at all... (http://p2p.wrox.com/showthread.php?t=44026)

Jurjen June 15th, 2006 02:59 AM

WebParts not working at all...
I’ve been reading the first few chapters of your book, and was sitting down at my pc to try the example from Chapter 2 (page 31). Very simple example, but when running it (view in browser of F5) I get the following message from IE : Internet Explorer cannot display the webbpage

There’s no ASP.NET error, it compiles just fine...
I’ve tried this using VS2005 with a Website project as well as the new ASP.NET Web Application project but the results are the same.

I’ve done everything exactly as it’s written in the book, after removing the WebPartManager and the WebPartZone the page DOES show !

I’ve also looked at the errata for the book but have found none. I couldn’t find anything about this in the forum either.

I’ve tried this on my development machine as well as on my laptop, same result.

Did I forget something ?

Jurjen June 22nd, 2006 01:58 AM

During install of the new BETA2 version of IE7, I uninstalled IE7 and tried my little project against IE6, this time IE showed me an ASP.NET exception saying it was looking for database aspnetdb wich was non-existing. After creating the database the example worked just fine in both IE6 and IE7.


dmmattix July 1st, 2006 02:19 PM

The problem you are experiencing is due to Web Parts using the new Personalization and Membership functions in ASP.NET V2.0. This functionality uses a SQL database ASPNETDB. If you did not install (like me) the SQL Server 2005 Express during the VS 2005 install, this database was not created. I assume you did not take this option as you are getting this error. Scott Guthrie has a blog posting out on how to install this if you have SQL Server 2000 instead of 2005. Try searching for aspnet_sqlreg and see if anything pops up under blogs.asp.net/ScottGu (or something like that).


Mike Mattix

froens April 10th, 2008 03:51 PM

Hi there. I'm pretty new to all this .Net thing after playing for a while with JSP and PHP.

I'm experiencing some problems with the example on page 30-31. More exactly i'm having problems accessing the webparts at runtime/pageload time.

My code in the codebehind-file (i hope it's ok to post it here - if not, please direct me to where i'm supposed to post it):

namespace test1_webpart
    public partial class _Default : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
            this.WebPartZone1.WebParts[0].Title = "Search";

At runtime i get an error saying something about that my index is out of bounds. This could indicate that the Webparts collection is empty, which seems strange since the book explicitly says that collection is populated with generic webparts that acts as wrappers. What am I doing wrong ?

Just in case:
The web part zone WebPartZone1 is indeed containing controls which are supposed to be wrapped by web parts. These controls are the same as the ones the book suggests.

- Best Regards
  Frederik *^_^*

All times are GMT -4. The time now is 01:04 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.