locked
How do I add a Blend created user control to the toolbox in my ASP.NET project? RRS feed

  • Question

  • I created a user control in Blend and want to add it to the toolbox in my VS2005 ASP.NET project. I've created the user control as an .exe and a .dll. I can add the user control project to my ASP.NET project or I can reference the .dll. Either way, I still don't see how to add the control to the toolbox. Any suggestions?
    Wednesday, March 19, 2008 9:50 PM

Answers

  • Well, you don't get an assembly that you can just reference in your asp.net projects, (no matter if you have VS 2008), but you get "something" which can be easily embedded in any html file. I will talk about each type of Silverlight projects:

    1. Silverlight 1
    You need to share a few .js and .xaml files on the website. As I know, Visual Studio 2005 supports Silverlight 1.0 applications (they are regular website projects and the code is regular .js which gets executed on the client side).

    2. Silverlight 2
    You get a .xap file which can be embedded in any html file (and of course, anything rendering html: ASP.NET, php, etc) using on object tag. For that, all you need is to have that xap file available on the website.

    Now, in terms of creating a Silverlight 2 project, you can use Expression Blend for that; unfortunately, Expression Blend doesn't support debugging and it doesn't have intellisense - that's when you may need Visual Studio 2008.

    So, in both cases you can embed Silverlight content even if you don't have Visual Studio. You can also write Silverlight applications without having Visual Studio and even without Expression Blend, but it is more difficult.

    For more information, you should check out the Silverlight documentation.

    http://silverlight.net/GetStarted/

    Hope this helps,
    - Adrian

    - Adrian Vinca [MSFT]
    Content is provided "AS IS" with no warranties and confers no rights.
    Thursday, March 20, 2008 2:39 AM

All replies

  • Hi,

    You can use a Wpf (or Silverlight 2) UserControl only in Wpf (Silverlight 2) applications; basically you can't just instantiate an user control inside an ASP.NET page. However, you can include some Wpf applications / Silverlight applications inside ASP.NET pages (and those applications can use the user control you've created in Blend).

    Hope this helps,
    - Adrian

    - Adrian Vinca [MSFT]
    Content is provided "AS IS" with no warranties and confers no rights.
    Wednesday, March 19, 2008 10:36 PM
  • Thanks. It sounds like you confirmed what I just read. It appears I need to upgrade to Blend 2 beta to create web enabled controls and they can't be edited in VS2005 - only VS2008.

    Am I correct in assuming I can create a web control in Blend 2, build it as a .dll and reference it in a VS2005 ASP.NET project if I have loaded the .NET 3.5 framework?
    Wednesday, March 19, 2008 10:41 PM
  • Well, you don't get an assembly that you can just reference in your asp.net projects, (no matter if you have VS 2008), but you get "something" which can be easily embedded in any html file. I will talk about each type of Silverlight projects:

    1. Silverlight 1
    You need to share a few .js and .xaml files on the website. As I know, Visual Studio 2005 supports Silverlight 1.0 applications (they are regular website projects and the code is regular .js which gets executed on the client side).

    2. Silverlight 2
    You get a .xap file which can be embedded in any html file (and of course, anything rendering html: ASP.NET, php, etc) using on object tag. For that, all you need is to have that xap file available on the website.

    Now, in terms of creating a Silverlight 2 project, you can use Expression Blend for that; unfortunately, Expression Blend doesn't support debugging and it doesn't have intellisense - that's when you may need Visual Studio 2008.

    So, in both cases you can embed Silverlight content even if you don't have Visual Studio. You can also write Silverlight applications without having Visual Studio and even without Expression Blend, but it is more difficult.

    For more information, you should check out the Silverlight documentation.

    http://silverlight.net/GetStarted/

    Hope this helps,
    - Adrian

    - Adrian Vinca [MSFT]
    Content is provided "AS IS" with no warranties and confers no rights.
    Thursday, March 20, 2008 2:39 AM
  • Thanks again. Your answers clear-up quite a bit for me.
    Thursday, March 20, 2008 3:19 AM