I am working with a new wep application project and I built as usual. bin directory and images folder and MasterPages folder and my aspx pages
on the root of the application. My aspx page call the master page as following ~/MasterPages/Site.Master. but after uploading my files to the server I discovered an error saying that the masterpage i search for doesn't exist.
after discussing with my host manager at godaddy I found that the site is http://www.mysite.com while it is physically refers to
http://www.mysite.com/mysitesharedfolder. sure the aspx page can't find the masterpage because the path is invalid as there is an alias folder
after the root in which all my files exist I tried to change the path manually in my pages but I got error also I couldn't see my masterpage in the designer view any more. I tried to put my application within a folder but my bin, obj, properties, and references
folders are out but i also got the same error
Now I want a way to make my site works well within inside the alias directory. I also tried the syntax /MasterPages instead of ~/MasterPages
but I got the same error
genius perso...
Member
128 Points
198 Posts
hosting on a shred hosting
Feb 12, 2012 01:57 PM|LINK
Hi all forums,
I am working with a new wep application project and I built as usual. bin directory and images folder and MasterPages folder and my aspx pages
on the root of the application. My aspx page call the master page as following ~/MasterPages/Site.Master. but after uploading my files to the server I discovered an error saying that the masterpage i search for doesn't exist.
after discussing with my host manager at godaddy I found that the site is http://www.mysite.com while it is physically refers to
http://www.mysite.com/mysitesharedfolder. sure the aspx page can't find the masterpage because the path is invalid as there is an alias folder
after the root in which all my files exist I tried to change the path manually in my pages but I got error also I couldn't see my masterpage in the designer view any more. I tried to put my application within a folder but my bin, obj, properties, and references folders are out but i also got the same error
Now I want a way to make my site works well within inside the alias directory. I also tried the syntax /MasterPages instead of ~/MasterPages
but I got the same error
Kindly help
HostingASPNe...
All-Star
15876 Points
2974 Posts
Re: hosting on a shred hosting
Feb 12, 2012 03:36 PM|LINK
Hello,
You could receive such error on shared Windows hosting if you did not set the correct ASP.NET version.
Regards
</div>Free ASP.NET Examples and source code.
genius perso...
Member
128 Points
198 Posts
Re: hosting on a shred hosting
Feb 13, 2012 06:44 AM|LINK
Thanks for reply,
but I already defined my Asp.net version to 3.5
genius perso...
Member
128 Points
198 Posts
Re: hosting on a shred hosting
Feb 13, 2012 12:22 PM|LINK
Thanks for your reply,
but I already defined my asp.net version to 3.5
Alig
Member
114 Points
27 Posts
Re: hosting on a shred hosting
Feb 13, 2012 12:28 PM|LINK
try this
Server.MapPath("~/MasterPages/Site.Master");
genius perso...
Member
128 Points
198 Posts
Re: hosting on a shred hosting
Feb 15, 2012 06:41 AM|LINK
sorry to tell you that I got the same error
SonicMan
Participant
1472 Points
228 Posts
Re: hosting on a shred hosting
Feb 16, 2012 04:41 AM|LINK
Hi
Does this http://www.mysite.com/mysitesharedfolder structure are what you need?
Or you just need http://www.mysite.com/.
If you want line 2 you need to check your configuartion why you get this alias folder.
Or you can use ../ and ./ to get the relative path at the head of the content page.
For exmaple:
Root
masterpagefolder
Site1.Master
contentpagefolder
contentpage.aspx
You can use
<%@ Page Title="" Language="C#" MasterPageFile="../masterpagefolder/Site1.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebForm1" %>
instead ~/masterpagefolder/Site.Master