For some reason, the content folder or the root of the website is being protected by forms authentication. This is apparent by the fact that it's redirecting to the login form. Check the root's web.config or if the content folder has a web.config (for some
reason) to see if there's any weird forms authentication rule set. Also, did you modify the default routes in any way?
"If I can see further than anyone else, it is only because I am standing on the shoulders of giants."blog: www.heartysoft.com twitter: @ashic
I have a some problem which i mentioned below. This information raised when I try to send any Post. Please tell me the solution.
Either this forum does not exist or you are not allowed to post.
Apart from this I'am new user in MVC Framework application, basically I am a C# developer. I also tried lot's of example in MVC.
But may I want to create a simple application in which user can take value fron Field and send into database's table using connection String. (I.e SqlExpress 2005)& aslo do Insert Update & delete working..
gnomo
0 Points
5 Posts
MasterPage link to css
Sep 11, 2009 10:08 AM|LINK
Hello
I'm having some problems with a css link in the master page after deploying a ASP.NET MVC application to a shared hosting server.
I'm using the default project that visual studio creates for an MVC application.
In Site.Master the link for the css file is
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
but when running the project in VS2008 this is rendered to the browser as
<link href="Content/Site.css" rel="stylesheet" type="text/css" />
However, after deploying the site to a remote server with IIS 7.0 the same link is rendered has
<link href="../Content/Site.css" rel="stylesheet" type="text/css" />
Why is this happening? Any Ideas?
CSS master page programatic href
HeartattacK
All-Star
55262 Points
5917 Posts
Moderator
MVP
Re: MasterPage link to css
Sep 11, 2009 11:07 AM|LINK
Are you sure you've deployed the same masterpage? Even if you have, you'd almost always want to use this:
<link href='/content/site.css' rel='stylesheet' type='text/css' />
blog: www.heartysoft.com
twitter: @ashic
Mike Hildner
Member
226 Points
65 Posts
Re: MasterPage link to css
Sep 11, 2009 01:15 PM|LINK
I'm not sure if this is your issue, but I believe the preferred way is to use
<link href="<%= Url.Content("~/Content/Site.css") %>" rel="stylesheet" type="text/css" />
Which will keep things working when deployed to a virtual directory.
gnomo
0 Points
5 Posts
Re: MasterPage link to css
Sep 11, 2009 01:35 PM|LINK
Thanks for your reply!
I'm using the masterpage from the default template.
But it seems that this is just a side effect of something else,
Actually what is happening is that when I do "/" request like «http://www.mydomain.com/» I'm allways redirected to http://www.mydomain.com/Account/LogOn?ReturnUrl=/
And the same happens if I request the css directly!!!!
If I request http://www.mydomain.com/Content/Site.css I'm beeing redirected to
http://www.mydomain.com/Account/LogOn?ReturnUrl=/
gnomo
0 Points
5 Posts
Re: MasterPage link to css
Sep 11, 2009 01:38 PM|LINK
I forgot to mention two additional facts:
a request to
http://www.mydomain.com/Home/About works ok (although without css)
http://www.mydomain.com/Home/Index also works ok (although without css)
HeartattacK
All-Star
55262 Points
5917 Posts
Moderator
MVP
Re: MasterPage link to css
Sep 11, 2009 02:52 PM|LINK
For some reason, the content folder or the root of the website is being protected by forms authentication. This is apparent by the fact that it's redirecting to the login form. Check the root's web.config or if the content folder has a web.config (for some reason) to see if there's any weird forms authentication rule set. Also, did you modify the default routes in any way?
blog: www.heartysoft.com
twitter: @ashic
gnomo
0 Points
5 Posts
Re: MasterPage link to css
Sep 11, 2009 04:21 PM|LINK
</div><div>Something required by the hosting provider</div><div>
</div><div><system.webServer></div><div> <security></div><div> <authentication></div><div> <anonymousAuthentication userName="******" password="*********" /></div><div> </authentication></div><div> </security></div><div><system.webServer></div><div>
</div>
kaleemkhan
Member
28 Points
10 Posts
Some technical problem & MVC
Sep 11, 2009 04:36 PM|LINK
Hiiii ...
I have a some problem which i mentioned below. This information raised when I try to send any Post. Please tell me the solution.
Either this forum does not exist or you are not allowed to post.
Apart from this I'am new user in MVC Framework application, basically I am a C# developer. I also tried lot's of example in MVC.
But may I want to create a simple application in which user can take value fron Field and send into database's table using connection String. (I.e SqlExpress 2005)& aslo do Insert Update & delete working..
Thanks and Ragards in advance
KeFang Chen ...
Star
8329 Points
852 Posts
Re: Some technical problem & MVC
Sep 15, 2009 05:02 AM|LINK
Hi kaleemkhan,
Based on your description, if you haven't read some Tutorial about MVC, you can take a look at the following websites.
http://www.asp.net/learn/mvc/
http://nerddinnerbook.s3.amazonaws.com/Intro.htm