Page Directive

J

Jeff

Hi -

I'm trying to get my ASP.NET pages to work the same way on my development
machine (running from the VS.NET IDE) and on a remote (3rd-party) server.
The only way I've been able to come up with requires changing the page
directive for each page between codebehind (for the IDE) and src (for the
remote server). While that's a bit annoying for a single page, it's a
pretty untenable approach for a website with lots of pages.

Is there a way to set pages up so they work, unchanged, the same way in the
IDE and on a remote server?? How are all of you handling the issue?

Thanks for your help.

- Jeff
 
T

Tampa.NET Koder

How are you deploying your website. Do you deploy all you aspx files along
with a bin folder that has your compiled dll in it?
 
J

Jeff

I'v just been copying/FTPing the files (aspx, aspx.vb) to the remote root
directory. Seems to have been working (with the issue described in my
post).

I'm just moving from ASP to ASP.NET. So I'm accustomed to simply FTPing
files to deploy a site. What's the best way to deploy a site with ASP.NET?

And what's the simplest/fastest way to test pages on a remote server?

- Jeff
 
T

Tampa.NET Koder

Well, you can do it the same way you have been doing it. However, you don't
need to deploy you asp.vb files. Do not replace the CodeBehind in the page
directive with Src if you are doing it this way. Once you have compiled
your website in visual studio, then just ftp your aspx files, images, etc to
your web server. Then at the root directory of your website place your .dll
file in a bin folder (create it if necessary).

Now, this is critical; each project you do will have their own bin folder
within their web directory, you can do this ONLY if that folder is a virtual
directory which vs.net creates for you when you create your project.
However, you web hosting may not create these IIS virtual directories for
you. You can ask them, but if they don't, then like I said; at the root
directory of your hosted web space, create a folder call bin, then copy your
..dll file in that folder. Everything should be fine.
 
S

Scott M.

Why not just use the "Copy Project" feature built right into VS.NET for
doing just this? You will have the choice as to which files to deploy (all
files, only files needed to run application, etc.) and this way you won't
have to mess with any page directives.
 
J

Jeff

Yes, Scott, I'd like to do so. I'm having a bit of trouble configuring it
though - perhaps someone can help.

I'm using a 3rd-party host for my website (Interland if that makes a
difference). I've been deploying ASP websites on that host using
Dreamweaver's FTP feature. I still can do that with ASP.NET sites, and I
get around the page directive problem if I also copy the bin subdirectory
(Thanks Tampa).

But that requires several extra steps that I'd like to avoid by using copy
project within VS.NET. I just can't figure out what to put in the
Destination Project Folder and File Share Path fields of the VS Copy Project
dialog. (I've asked the tech folks at Interland; so far they're no help.
I've also read and tried to follow the MS article at
http://msdn.microsoft.com/library/d...n-us/vsintro7/html/vxurfcopyprojectdialog.asp.
Also no success.)

I'm guessing that VS Copy Project is not the same as FTP, but I really don't
know. One potential issue is the FTP user name and password. Easy to set
up in Dreamweaver, but I don't see anywhere for it in VS. I have the
following information from my host:

domain (www.mydomain.com)
FTP Server (ftp.mydomain.com)
user name
password

How can I set up Copy Project in VS for a 3rd-party host??

Thanks again for your help.

- Jeff
 
M

Mark Fitzpatrick

Jeff,
The copy project does not use the FTP protocol. Instead it uses
HTTP, specifically through the FrontPage Server Extensions. You can publish
directly to Interland by configuring the FP Server Extensions through the
Interland management control panel. The FP Server Extensions shouldn't mess
up anything you are doing as you aren't making use of them except as a
publishing tool. The FP Server Extensions let VS and other enabled programs
to connect directly to the web server itself and not worry about going
through the FTP server.

If you want to use FTP for more control. you could actually just
publish it to your computer in a new directory for the webserver, such as
http://localhost/copy_of_myweb (VS.Net will add the copy_of_ automatically
the first time as an example). Then you can create a new dreamweaver site,
pointing to this new location and then using the FTP functionality there to
publish this version of the web, which has everything compiled and won't
contain the codebehind.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
T

Tampa.NET Koder

VS.NET copy project uses Front Page Extensions. If it is installed and
enabled on your server then you are good to go. It it is much much slower
than FTP and you are unable to select a single file to upload. All files
must be uploaded everytime you make a change. So, when you bring up the
copy project dialog, you will see the destination. You would want to do
something like this: http://www.yoursite.com/ or
http://www.yoursite.com/YourWebApp. If you do the first one, then all you
files will be copied to the root of your website. If you do the second one,
then Front Page Extensions will create a virtual directory on your web host
(just like visual studio does) and keep all our files in one contained
application folder.

For the options at the bottom, choose to copy only files to run this
application. Hope this helps
 
J

Jeff

Thanks to both you and Mark -

Can you please explain the purpose of the File share option (as opposed to
the FrontPage option)? Is it not possible for me to use that option?

I may still use Mark's suggested 'copy of' option in combination with
Dreamweaver (or some FTP solution). But I'd like to understand the 'native'
VS option(s) before deciding how/whether to use them. It knid of sounds
like most people with remote hosts would be well advised to _not_ use them.

Thanks again for your help.

- Jeff
 
S

Scott M.

Correction: All files do NOT need to be updated each time a change is made.
If the change is an HTML change, then just the .aspx file can be updated.
If the change was a change to compiled code then the new assembly (and
possibly the .aspx file) would need to be uploaded. You do NOT need to
upload everything each time a change is made.
 
S

Scott M.

Jeff, let me see if I can clarify some of this for you...

Visual Studio.NET has 2 methods it can use to access a project (whether that
project is local on your hard drive or remote on your ISP's machine),
FrontPage Server Extensions & File Share.

FrontPage Server Extensions are a way of configuring a virtual directory
with certain components that allow Visual Studio to communicate with that
"web" and give it instructions via http.

File Share simply means the folder has been given sharing permissions to a
specific user account (or more than one specific user account or group).

The Copy Project feature asks you to select how you wish to access the
remote "web" and FrontPage Server Extensions is the default. Now, follow me
on this...

If you ISP supports ASP.NET, they also probably support the FrontPage Server
Extensions although they may NOT have pre-configured your web site with
these extensions. If they have, then there is an empty "web" located at
your sites address. Now, you may have files in your web site, but if you
have never published to your web site using FrontPage Server Extensions,
then that web is technically empty. If they haven't, they may offer a
configuration method (their Control Panel) for you to configure your site
with the FP Extensions. After doing this, you would use the Copy Project
feature in VS.NET, select FP Server Extensions as the method, put your full
domain name in as the Destination Project Folder (for example:
http://www.YourSiteName.com) and then select Only Files needed to run this
application. You would then click OK. After a moment to contact the
server, a dialog would appear asking your to provided a user name and a
password to authenticate your ability to upload to this server. After that,
the files are uploaded.

After your site is uploaded, you take care of further updates in different
ways. If you just make an HTML change or a change to static text in one of
your .aspx pages, you can FTP just the updated .aspx page (using normal FTP
software) to your site. If you made a change to compiled code, then you
need to update the compiled assembly in the /bin folder, but you could just
FTP that updated file as well. For my sites, if I have to make an HTML
change, I use FrontPage to make the change and publish the new .aspx page.
If I have to make a change to code, I do it in VS.NET and use Copy Project
to upload the new assembly.

-Scott
 
J

Jeff

Thanks Scott, for taking the time to explain.

I think I'm good to go now, and I appreciate your help.

- Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,619
Members
45,315
Latest member
VernellPos

Latest Threads

Top