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.