| Author |
Message |
jhat10
Guest
|
Posted:
Fri Nov 04, 2005 8:12 am Post subject:
Developing Web Parts in VS2005 |
|
|
I have a basic web part that I started developing in VS2k3 and thought it
would be a decent idea to finish it with VS2k5 but alas...it won't upgrade
correctly and it appears that VS2k5 does not support developing Web Parts.
The Web Part kits that include the appropriate project templates which were
available for VS2k3 do not work in VS2k5.
Do I need to just down grade? Or maybe I am just not looking in the right
spot?
Anyone run into this yet? |
|
| Back to top |
|
 |
Daniel Larson (www.portal
Guest
|
Posted:
Fri Nov 04, 2005 9:51 am Post subject:
RE: Developing Web Parts in VS2005 |
|
|
You can program a WebPart without the project templates-- just set a
reference to the sahrepoint dll, and inherit from WebPart. My projects
upgraded just fine-- can you provide any more information on your failed
attempt?
Daniel Larson
"jhat10" wrote:
| Quote: | I have a basic web part that I started developing in VS2k3 and thought it
would be a decent idea to finish it with VS2k5 but alas...it won't upgrade
correctly and it appears that VS2k5 does not support developing Web Parts.
The Web Part kits that include the appropriate project templates which were
available for VS2k3 do not work in VS2k5.
Do I need to just down grade? Or maybe I am just not looking in the right
spot?
Anyone run into this yet?
|
|
|
| Back to top |
|
 |
Jason Kendall
Guest
|
Posted:
Fri Nov 04, 2005 9:51 pm Post subject:
Re: Developing Web Parts in VS2005 |
|
|
Daniel,
I have made several attempts to build a webpart in VS2005. I've done
it by hand coding the ui by overriding CreateChildControls() and I've
also tried it by creating a UserControl and sucking that into a
webpart.
So far, I've been unsuccessful. Do you have a very simple project
that you'd be willing to make available? If you are able demonstrate
how to use a VS2005 User Control, that'd be tremendous 'cause it's
just so much easier to build and test the UI, but even a 'Hello World'
VS2005 web part and instructions on how to successfully deploy it
would be MUCH appreciated. I know I must be doing something bascially
wrong, but just can't figure it out.
Thanks!
--
Jason Kendall
rowanstimpson@gmail.com
On Thu, 3 Nov 2005 23:37:02 -0800, "Daniel Larson
(www.portalbuilder.org)" <daniel@larsontechnology.spamfree.com> wrote:
| Quote: | You can program a WebPart without the project templates-- just set a
reference to the sahrepoint dll, and inherit from WebPart. My projects
upgraded just fine-- can you provide any more information on your failed
attempt?
Daniel Larson
"jhat10" wrote:
I have a basic web part that I started developing in VS2k3 and thought it
would be a decent idea to finish it with VS2k5 but alas...it won't upgrade
correctly and it appears that VS2k5 does not support developing Web Parts.
The Web Part kits that include the appropriate project templates which were
available for VS2k3 do not work in VS2k5.
Do I need to just down grade? Or maybe I am just not looking in the right
spot?
Anyone run into this yet?
|
|
|
| Back to top |
|
 |
jhat10
Guest
|
Posted:
Mon Nov 07, 2005 1:50 am Post subject:
Re: Developing Web Parts in VS2005 |
|
|
I finally got my Web Part to compile in VS2005 but now it won't execute. I
get the 'web part not safe' message. I swear I am about to go blind trying
to figure out if I have a syntax error in web.config or my *.dwp file.
Am I missing something new for .NET 2.0? I feel like I have done everything
that I did when I compiled this thing in .NET 1.1 (and it worked then) but
this just isn't working.
So yes, if you could provide any insite on what you did to get this working,
it would be GREATLY appreciated!
Thanks!
Jeff
"Jason Kendall" wrote:
| Quote: | Daniel,
I have made several attempts to build a webpart in VS2005. I've done
it by hand coding the ui by overriding CreateChildControls() and I've
also tried it by creating a UserControl and sucking that into a
webpart.
So far, I've been unsuccessful. Do you have a very simple project
that you'd be willing to make available? If you are able demonstrate
how to use a VS2005 User Control, that'd be tremendous 'cause it's
just so much easier to build and test the UI, but even a 'Hello World'
VS2005 web part and instructions on how to successfully deploy it
would be MUCH appreciated. I know I must be doing something bascially
wrong, but just can't figure it out.
Thanks!
--
Jason Kendall
rowanstimpson@gmail.com
On Thu, 3 Nov 2005 23:37:02 -0800, "Daniel Larson
(www.portalbuilder.org)" <daniel@larsontechnology.spamfree.com> wrote:
You can program a WebPart without the project templates-- just set a
reference to the sahrepoint dll, and inherit from WebPart. My projects
upgraded just fine-- can you provide any more information on your failed
attempt?
Daniel Larson
"jhat10" wrote:
I have a basic web part that I started developing in VS2k3 and thought it
would be a decent idea to finish it with VS2k5 but alas...it won't upgrade
correctly and it appears that VS2k5 does not support developing Web Parts.
The Web Part kits that include the appropriate project templates which were
available for VS2k3 do not work in VS2k5.
Do I need to just down grade? Or maybe I am just not looking in the right
spot?
Anyone run into this yet?
|
|
|
| Back to top |
|
 |
Daniel Larson (www.portal
Guest
|
|
| Back to top |
|
 |
Jason Kendall
Guest
|
Posted:
Mon Nov 07, 2005 5:51 pm Post subject:
Re: Developing Web Parts in VS2005 |
|
|
That is just the "dumbed down" step by step example I needed. Daniel,
you're awesome. While it would be nice to be able to use VS2005 user
controls and load them into a webpart referencing the current
SharePoint libraries, at least I can use VS2005 for building my
webparts now.
Thanks!
--
Jason Kendall
rowanstimpson@gmail.com
On Mon, 7 Nov 2005 00:05:16 -0800, "Daniel Larson
(www.portalbuilder.org)" <daniel@larsontechnology.spamfree.com> wrote:
|
|
| Back to top |
|
 |
Jason Kendall
Guest
|
Posted:
Mon Nov 07, 2005 9:51 pm Post subject:
Re: Developing Web Parts in VS2005 |
|
|
You are, indeed, a font of valuable information!
So, since asp.net has such a screwey pre-compile structure, should I
just put the server side code in the .ascx file as well, so both code
and markup are in one file that gets JIT compiled when referenced?
When I try to pre-compile a web project containing my user control, I
get assembly names that are hard to decipher once deployed.
I will look into the SDK for details on this. I'll also check out
portalbuilder.org.
Thanks again!
--
Jason Kendall
rowanstimpson@gmail.com
On Mon, 7 Nov 2005 10:16:01 -0800, "Daniel Larson
(www.portalbuilder.org)" <daniel@larsontechnology.spamfree.com> wrote:
| Quote: | Thanks Jason!
YES-- you can use your user controls. Place them in the wwwroot/controls
folder (or another appropriate folder... ) and add them to the controls
collection of your webpart after loading them. Like this, if I remember
correctly:
// assumes web is c:/inetpub/wwwroot and control is located at
// c:/inetpub/wwwroot/controls/mycontrol.ascx
Control uc = this.Page.Load("/controls/mycontrol.ascx");
this.Controls.Add(uc);
That is the basics... WebControls are preferred over UserControls, but if
you have a lot of HTML in the control or want to reuse different ASCX files
for the same control, this approach works good. You can make your own User
Control wrapper by making the control path a WebPart property (see the SDK
for a great reference on this). You also may want to make the user control a
private field in the WebPart class if you go that route.
Daniel Larson
http://feeds.feedburner.com/daniellarson
"Jason Kendall" wrote:
That is just the "dumbed down" step by step example I needed. Daniel,
you're awesome. While it would be nice to be able to use VS2005 user
controls and load them into a webpart referencing the current
SharePoint libraries, at least I can use VS2005 for building my
webparts now.
Thanks!
--
Jason Kendall
rowanstimpson@gmail.com
On Mon, 7 Nov 2005 00:05:16 -0800, "Daniel Larson
(www.portalbuilder.org)" <daniel@larsontechnology.spamfree.com> wrote:
Jason and Jeff,
I posted a basic walkthrough here:
http://msdn.microsoft.com/newsgroups/managed/default.aspx?&guid=&sloc=en-us&dg=microsoft.public.sharepoint.portalserver.development&p=1&tid=d6ecc9ef-6d14-4011-bd04-4a5987b0bf6b
Daniel Larson
http://feeds.feedburner.com/daniellarson
|
|
|
| Back to top |
|
 |
Daniel Larson (www.portal
Guest
|
Posted:
Mon Nov 07, 2005 9:51 pm Post subject:
Re: Developing Web Parts in VS2005 |
|
|
Thanks Jason!
YES-- you can use your user controls. Place them in the wwwroot/controls
folder (or another appropriate folder... ) and add them to the controls
collection of your webpart after loading them. Like this, if I remember
correctly:
// assumes web is c:/inetpub/wwwroot and control is located at
// c:/inetpub/wwwroot/controls/mycontrol.ascx
Control uc = this.Page.Load("/controls/mycontrol.ascx");
this.Controls.Add(uc);
That is the basics... WebControls are preferred over UserControls, but if
you have a lot of HTML in the control or want to reuse different ASCX files
for the same control, this approach works good. You can make your own User
Control wrapper by making the control path a WebPart property (see the SDK
for a great reference on this). You also may want to make the user control a
private field in the WebPart class if you go that route.
Daniel Larson
http://feeds.feedburner.com/daniellarson
"Jason Kendall" wrote:
|
|
| Back to top |
|
 |
|
|
|
|