Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 20th, 2014, 10:43 PM
Authorized User
 
Join Date: Dec 2013
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default uploading site to server

Hello I am having some problems with uploading my website to a server that is being hosted by hostgator.com.
I just built a portfolio type website using visual web developer, and with the skills I learned from reading asp.net 4 in C# and vb book from like chapter 1 through 12.
It works and debugs great in visual studio, but when I put it on the server, it says it cant find specific files that are in subfolders, which is what I did in visual studio to make it more organized. I talked to hostgator.com and they havn't been able to help me with this issue. I can probably put it all on the server where it would work, but I would have to exclude all the sub directories, and put all the files in one folder, and I would also have to change a lot of code in the markup, because in the markup a lot of files are being called from sub directories.
Shouldn't it work the same on the server as it does in visual studio, because it just doesn't seem logical to have to change folders around and your code just to put it on the server
Here is the website that I have on the server, where you can see the error
portfoliobrown.com/My_Portfolio
and again I don't get that in visual studio it works fine
I Appreciate any help
Thanks
 
Old January 21st, 2014, 05:22 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Is My_Portfolio the folder where all you stuff lives, like web.config and the MasterPages folder? If so, the error makes sense. You're pointing to the root of the server, so it tries to find the master page at /MasterPages, rather than at /My_Portfolio/MasterPages.

Two solutions:

1. Move everything from the My_Portfolio folder to the root, keeping the structure in place.

2. Mark /My_Portfolio as a virtual directory / application. Maybe your host can do that, or you can do it through a control panel if that's what they offer. That way, something like ~/MasterPages will resolve to /My_Portfolio/MasterPages instead of /MasterPages.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 22nd, 2014, 12:37 AM
Authorized User
 
Join Date: Dec 2013
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hey

Hey thanks a lot
its working I can't believe I didn't think of that before, but that was the only issue.
So I have one more issue. My contact form doesn't work on the server receiving the email the form, like it did when I ran it in visual studio. It has the same code in C# from the book that I have for my contact form. My host couldn't help me with it either. Maybe you might have the solution
Thanks
 
Old January 22nd, 2014, 03:51 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Most likely this is due to mail server configuration. Try removing the UpdatePanel to see the real error, or try the mail demo page from the Demo folder. This will make it easier to see what the problem is so you can see what you need to fix.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 22nd, 2014, 06:14 AM
EricCulbertson
Guest
 
Posts: n/a
Default

appreciate the suggestion and i will do it to fix it
 
Old January 22nd, 2014, 08:14 PM
Authorized User
 
Join Date: Dec 2013
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hi

Okay after removing the update panel from the markup for the contact form, and sending it this is the error that I receive.

An attempt was made to access a socket in a way forbidden by its access permissions 173.194.64.109:587

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 173.194.64.109:587

Source Error:


Line 46:
Line 47: SmtpClient mySmtpClient = new SmtpClient();
Line 48: mySmtpClient.Send(myMessage);
Line 49:
Line 50: Message.Visible = true;

It states that line 48 is causing the issue. Its weird because it works fine when I debug it, just the server its on doesn't like it for some reason
Thanks
 
Old January 23rd, 2014, 11:33 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I think you'll need to talk to your host to figure out how they allow you to send e-mail. It sounds like you're not allowed to send e-mail to the configured server / port from their network.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 26th, 2014, 04:09 PM
Authorized User
 
Join Date: Dec 2013
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Alright thanks a lot for your help.
Apparently it was the package that I signed up for that doesn't allow email sending.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with uploading final site/database to GoDaddy SamuelMSr BOOK: Beginning ASP.NET 4 : in C# and VB 12 October 12th, 2011 10:59 AM
Uploading video files on to my site palvin Classic ASP Components 1 September 29th, 2011 06:39 AM
Uploading files to hosting site. tankeros BOOK: Beginning ASP.NET 4 : in C# and VB 1 November 10th, 2010 02:51 AM
Uploading video files on to my site palvin Classic ASP Professional 0 March 1st, 2006 11:13 AM
uploading site aspnet79434319 Classic ASP Basics 1 June 25th, 2005 11:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.