Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / October 2004

Tip: Looking for answers? Try searching our database.

AddFromTemplate

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
back2grid - 13 Oct 2004 22:41 GMT
Hi,
i'm am creating a custom web project. As part of it, i'm copying over some
files from the template directory to project location. The problem is with
aspx or asmx files. i'm using AddFromTemplate method to add .aspx .asmx files
to the project folder. the problem is that i need these files to be copied
over to a specific folder inside the project
(c:\inetpub\wwwroot\projectFolder\webservices). but this method is copying
the files to the project foot folder (c:\inetpub\wwwroot\projectFolder). i
have the files already copied over the specific folder.

If i use AddFromFile, VS.net wants to have a code-behind for the aspx file.
Mythran - 14 Oct 2004 00:37 GMT
Unfortunately, you'll still get the code-behind file using AddFromTemplate.  But,
if you want to place it under the webservices folder under projectFolder...you'll
do something like the following:

Project.ProjectItems.Item("webservices").ProjectItems.AddFromTemplate(...)

Try that :)

Hope that helps :)

Mythran

> Hi,
> i'm am creating a custom web project. As part of it, i'm copying over some
[quoted text clipped - 7 lines]
>
> If i use AddFromFile, VS.net wants to have a code-behind for the aspx file.
back2grid - 14 Oct 2004 16:51 GMT
Hi,
thanks for the reply...
The Item("webservices") wants an object index and not folder name. an
incorrect parameter error is occuring. I am looking at getting the index of
the project item and try it again..

> Unfortunately, you'll still get the code-behind file using AddFromTemplate.  But,
> if you want to place it under the webservices folder under projectFolder...you'll
[quoted text clipped - 19 lines]
> >
> > If i use AddFromFile, VS.net wants to have a code-behind for the aspx file.
Mythran - 14 Oct 2004 19:41 GMT
Dim webServicesFolder As EnvDTE.ProjectItem =
Project.ProjectItems.Item("webservices")

works beautifully for me.  Maybe a parameter in AddFromTEmplate is wrong on your
part.  Check it out :)

The item indexer expects either an integer (index) or key name (index).  Not an
object like the item itself.

Mythran

> Hi,
> thanks for the reply...
[quoted text clipped - 25 lines]
> > >
> > > If i use AddFromFile, VS.net wants to have a code-behind for the aspx file.
back2grid - 15 Oct 2004 19:13 GMT
thanks for the reply,
I'm not looking to add a web-reference folder to the project. can you tell
me a way to add a aspx or asmx file with no attached code-behind to a
specific folder without visual studio requesting the user to add a code
behind. i have ten such files and one has to click ten dialog boxes in order
to get the project copied over completely.

Also i'm creating folders inside the project through
system.io.directory.createdirectory. then i'm adding the project items to the
project.

> Dim webServicesFolder As EnvDTE.ProjectItem =
> Project.ProjectItems.Item("webservices")
[quoted text clipped - 39 lines]
> > > >
> > > > If i use AddFromFile, VS.net wants to have a code-behind for the aspx file.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.