Logo 
Search:

MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

Deploy .ASCX files in Solution/Feature ?

  Asked By: Stevie    Date: Jun 12    Category: MOSS    Views: 11631

I've got .ascx files for use within a small User Control Container web
part (like smartpart) that I want to deploy to a MOSS install.

I have created a Solution and contained Feature, but I can't figure
out how to make my files "end up" in "<webroot>/WebUserControls" as
needed by the container web part.

For example, I have "WebUserControls/MyApplicationsControl.ascx" in my
VS 2005 project, and I want it to end up copied to:
C:\Inetpub\wwwroot\wss\VirtualDirectories\80\MyApplicationsControl.ascx


Could someone provide or find an example?
This .ascx file isn't really even for user browsing directly, so is
this type of deployment with features even possible?

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Dara Hobbs     Answered On: Jun 12

There is almost no way to use a solution  or Feature to deploy  any file
to a hard drive location outside the 12 hive. However, using a Module
element in the Feature you could easily deploy the file to a location
relative to the root of the Site. Then you could address the .ascx
control in you container by using a relative address within the site.
The only difference is that the control  would stored in the content
database, not in the file system.

 
Answer #2    Answered By: Abhinivesh Suvarna     Answered On: Jun 12

Now I'm going to try an SPFeatureReceiver.FeatureInstalled() method
to copy the files  "where I want them" when the feature  is installed.

 
Answer #3    Answered By: Micheal Knight     Answered On: Jun 12

I got this to work pretty well.

There is the strange issue that installing the solution  puts certain
dlls in the GAC, but the .ascx files  don't show up off the webroot
until I active the feature. I'm struggling with that one to determine
if I like it or not.

I wanted to put the copy code into the
SPFeatureReceiver.FeatureInstalled(SPFeatureReceiverProperties
properties), but the properties.Feature is always null, so I can't
determine the webroot of the site for where to copy my files to!

 
Didn't find what you were looking for? Find more on Deploy .ASCX files in Solution/Feature ? Or get search suggestion and latest updates.




Tagged: