Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Using an ASP.NET User Web Control on a WSS WebPart

Using an ASP.NET User Web Control on a WSS WebPart

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsharepointdatabasedotnet
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Ken Mazaika
    wrote on last edited by
    #1

    I've spent an hour trying to do this and I can't figure out what's going on. I have a class that I derived from Microsoft.SharePoint.WebPartPages.WebPart. I built the program, and copied the dll's to C:\inetpub\wwwroot\wss\VirtualDirectories\3141\bin. I registered the WebPart through a dwp file. The webpart works great (queries a database and outputs text). I'm trying to build a User Control and include it in the webpart. To do this I put this in the Web Part's Render method: System.Web.UI.Control control = this.TemplateControl.LoadControl(@"WebUserControl.ascx"); Controls.Add(control); because of various examples online. Program compiles fine. I copied the WebUserControl.ascx all over the place to over all the tutorials I found that had it different places. Before I copied it to a lot of places I was getting WebUserControl.ascx file not found. Now I'm getting the exception: Request Failed Anyone have any ideas about what I'm not doing right? I'm not installing the dll to the GAC, I'm not sure if that has anything to do with it. Thanks, -Ken

    T 1 Reply Last reply
    0
    • K Ken Mazaika

      I've spent an hour trying to do this and I can't figure out what's going on. I have a class that I derived from Microsoft.SharePoint.WebPartPages.WebPart. I built the program, and copied the dll's to C:\inetpub\wwwroot\wss\VirtualDirectories\3141\bin. I registered the WebPart through a dwp file. The webpart works great (queries a database and outputs text). I'm trying to build a User Control and include it in the webpart. To do this I put this in the Web Part's Render method: System.Web.UI.Control control = this.TemplateControl.LoadControl(@"WebUserControl.ascx"); Controls.Add(control); because of various examples online. Program compiles fine. I copied the WebUserControl.ascx all over the place to over all the tutorials I found that had it different places. Before I copied it to a lot of places I was getting WebUserControl.ascx file not found. Now I'm getting the exception: Request Failed Anyone have any ideas about what I'm not doing right? I'm not installing the dll to the GAC, I'm not sure if that has anything to do with it. Thanks, -Ken

      T Offline
      T Offline
      ToddHileHoffer
      wrote on last edited by
      #2

      Ken, I could never do sharepoint programming. However, I know an easy way to use user controls in SP webparts. Check this out. http://www.codeplex.com/smartpart[^] This is the easy way to implement a .ascx as a webpart.

      I didn't get any requirements for the signature

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups