MVC :: Routes Not Working On Site Root?
Jan 27, 2011
On a MVC 3 site I have a area named "CMS" on on CMSAreaRegistration I have:
[Code]....
All the CMS controller are under the namespace Site.CMS.Controllers And in Global.Asax I have:
[Code]....
The CMS routes seem to work as expected. But the following link on my site root:
[Code]....
I tried many options to try to solve it but I always get something wrong.
View 13 Replies
Similar Messages:
Feb 11, 2011
I am using iis 5.1 in which we have only only one default website, I have two projects v2 and v3 my website points to v2 projects and have some folders images, styles etc now i have a virtual directory under this website that is hosting project v3 and having the same folder hierarchy as v2 in the home page of the both projects i have img src="imagesedlogo.gif" alt="logo"/> but this shows the same image that is in the v2 directory, How can i show different images for both projects. using "" get the root of the web site but how can i get the root of virtual directory under that website
View 2 Replies
Jan 3, 2010
Is not a lot of fun of yielding much success at the moment.
When I copy my web site on the local machine some of the CSS classes in my themes are not applied. Although not major, I am concerned at what may be causing this.
My real problem is regard the root of the site. On my personal machin, I have set the root of my site using the tilde syntax. However, the root of the web site on my host's ftp site is wwwroot.
Does this mean that I need to change a setting somewhere for the page to be recognised?
View 4 Replies
Feb 19, 2011
i have changed the routes and now the layout is not working
this the new route
[Code]....
this is where iam calling the MostraAds
[Code]....
this is the view
[Code]....
this is the controller
[Code]....
the problem is not showing the layout
[Code]....
View 2 Replies
Apr 4, 2011
I want to completely understand how to use relative and absolute url address in static and dynamic files.~ : / :.. : in a relative URL indicates the parent directory . : efers to the current directory / : always replaces the entire pathname of the base RL// : always replaces everything from the hostname onwardsThis example is easy when you are working without virtual directory. But i am working on virtual directory
View 1 Replies
Sep 28, 2010
I am a PHP developer and have been asked to make some slight amendments to an ASP.net site. I can make these amendments but the biggest challenge seems to be getting the actual site up and running on my own server! I have a had lots of errors with regards to the paths to files, as the website is linked absolutely to the root folder and on my development server I cannot have the files at the root. I have therefore worked my way through some of the files making the paths relative so I can at least see some of the site running but then I came across this error:
CS0103: The name 'Data' does not exist in the current context
Line 5: protected void Page_Load(object sender, EventArgs args)
Line 6: {
Line 7: rptNews.DataSource = Data.NewsArticle.GetLatestNews(3);
Line 8: rptNews.DataBind();
Line 9: }
I assume this is something to do with data being called from a database. How to get the site and database up and running as I have no idea where to start and feel I am going round in circles.
View 4 Replies
Feb 28, 2011
I am learning .net and I have implemented SiteMapPath on a site i'm developing which uses Url Routing. It is working fine for static routes but i am trying to get it to work on a dynamically generated route that passes a {date} and a {title} but I can't find any information on it anywhere, I have a book but it doesn't go in to SiteMapPath with UrlRouting.
I have set up routes in Global.asax file:
[Code]....
My web.sitemap currently looks like:
[Code]....
View 1 Replies
Mar 26, 2011
So my website works great on my local computer. It also works fine when I use the Copy Web Site feature in Visual Web Developer 2010 Express. But I do not want all of my files and the default.aspx to be sitting at the root of my domain name. I want it to be in a subfolder.
So again, it works fine when it's sitting at www.domainname.com
But when I use my FTP program to move the files to:
www.domainname.com/subfolder/
I get an error when I try to visit the site. It's just a general runtime error and does not display the specific error message. It obviously must have something to do with when I MOVE the files/folders from the root of the domain to the subfolder?
View 2 Replies
Apr 28, 2010
I know that to use link a view found in one view to one in another, i need to use;
[Code]....
But what if i want to link FROM an area to a view in the root of the site? This view is in the views folder found in the root, NOT in any area.
View 2 Replies
Aug 18, 2010
I've got webform routing setup on my asp.net webforms 3.5sp1 project. I would like to have the files for the site in a directory called content including the home page as I would like to run multiple sites using the same system. In MVC there is a blank default page and the home page is in a folder called home. I can't seem to replicate this behaviour using web form routing but would like to. The blank page is always hit first. the route handler is hit second - it recognises that the request is for the home page and sets up the routing page but is not used. the route handler code is simple:
public string VirtualPath { get; private set; }
public IHttpHandler GetHttpHandler(RequestContext
requestContext)
{
string file = requestContext.RouteData.GetRequiredString("File");
string id = requestContext.RouteData.GetRequiredString("Id");
string queryString = "?menuid=" + id;
VirtualPath = "~/" + file;
HttpContext.Current.RewritePath(
string.Concat(
VirtualPath,
queryString));
var page = BuildManager.CreateInstanceFromVirtualPath
(VirtualPath, typeof(Page)) as IHttpHandler;
return page;
}
Is there anyway I can do this?
Update
Here is my global.asax route code:
public static void RegisterRoutes(RouteCollection routes)
{
Domain.RepositoryFactory repo = new RepositoryFactory();
foreach (var x in repo.MenuRepository.GetAllEnabledGetMenus())
{
if (string.IsNullOrEmpty(x.Url))
{
//add default
System.Web.Routing.RouteTable.Routes.Add(
new Route("Default.aspx",
new RouteValueDictionary(new { File = x.FileName,
Id = x.Id.ToString() }),
new CoreRouteHandler()));
}
else
{
string url = x.Url;
if(x.Url.StartsWith("/"))
{
url = url.Remove(0, 1);
}
System.Web.Routing.RouteTable.Routes.Add(
new System.Web.Routing.Route(url,
new RouteValueDictionary(new {File = x.FileName,
Id = x.Id.ToString()}),
new CoreRouteHandler()));
}
}
}
View 2 Replies
Apr 30, 2010
Suddenly, IIS 7.0 is redirecting every request for the root of any domain hosted on the box to ~/Account/Logon, which is our Forms Authentication redirect. Additionally, some JavaScript and image requests are being similarly redirected, but not other aspx pages.
EDIT: It turns out that something has gone wrong with the disk permissions. Can anyone point me to the way things are supposed to be in Windows Server 2008 for a standard ASP.Net installation? The disk permissions are out of whack now.
View 1 Replies
May 25, 2010
I'm trying to prevent direct file requests from being accepted, and have tried this:
[Code]....
None of these worked. I want the rule to exclude any file of any filename in any directory with a matching extension. How can this be done?
View 11 Replies
Oct 27, 2010
I made an aspx site with .net 4.0 framework through visual studio and it worked perfectly in the development environment but when I upload it to the server and try to run it I get this error: Server Error in '/' Application. Runtime Error Does anyone have an idea on how to fix this?
View 4 Replies
Jan 27, 2010
I ran into the following issue when trying to run a test website on IIS 7.5 (Windows Server 2008 R2 DatacenterEdition). The web-app is configured to run with framework version 3.5 in a .Net 2.0 app pool. Also the framework 4.0 beta 2 is installed on the server. The application named 'TestPfade' is located under the website's root named 'Default'. It is not only a virtual directory but defined as an application. The folder structure looks like this: The markup of the sole document reads as follows:
[Code]....
When viewed in a browser the image gets shown because the given relative path is correctly resolved to 'images/Lighthouse.jpg' but the paths to the ajax-framework resources also include the application's root folder and therefor aren't found: 'src="/TestPfade/WebResource.axd?d=1bX...' Here is the complete html-source generated:
[Code]....
View 9 Replies
Sep 17, 2010
How can you request the root default.aspx without specifying it in the url for your root application?e.g. ttp://localhost/MyApp/ instead of http://localhost/MyApp/Default.aspxshould be able to do bothI'm not sure if this is a setting in IIS 7.5 for the application or what.
View 3 Replies
Jan 9, 2011
I am trying to create an Area for running DynamicData with scaffolding as an administration part. It's probably working as it should but I can't get the routing to work.
In my global.asax I have the following function to register the routes:
[Code]....
Unfortunately the "best" thing that happened to me so far was that when I check the default tables I get a message about (MetaModel.VisibleTables)
[Code]....
The problem is that I don't know why this is. Is it the routing or something else? Is it perhaps some security thing or can I not put dynamic data inside an area?
The DynamicData folder itself is located in the root of the application since that is the convention it uses and I have no intention to override that.
View 1 Replies
Jan 25, 2011
OK Here is the situation:
I have a web app with a table of statistics on our salesmen's customers, and each row has a sparkline graph showing the general trend of the sales data for the last 12 months. Each page shows a particular salesman's customer list, and some of them can have an enormous number of customers = an enormous number of rows = an enormous number of sparklines (e.g. one in particular has 125 and takes 15 seconds to load).
For this reason, jQuery sparklines could not be used - they completely pinned the CPU of a user accessing a page with a lot of sparklines with IE.
So I moved on to using the Google Chart API, which worked much better, except for two issues: 1) it's on a secure site, and the Google Chart API URL is only served over HTTP (solved by using a small wrapper script to download the graph dynamically and re-serve it from our secure server); and 2) on a page with 125 sparklines, it was still very slow due to the number of requests (even when the 0-9 server prefixes are used to maximize the # of available connections).
So my next step beyond this was to try to make each of the "download/grab/re-serve image" method calls asynchronous - and it worked!
...but only on my dev box running in debug mode.
When I pushed it up to the live site, it was faster, but it left some of the images unloaded, which is of course unacceptable.
So here is what I was hoping some SO hotshot would know:
1) Why are my asynchronous method calls working while debugging, but not working on the live site?
2) Is there any easier way to get a large number of sparklines of some sort to load quickly on a secure server without making me want to tear my hair out?
2a.) Does anyone have any experience using the ASP.NET Chart Library? Is this something I should investigate?
2b.) A co-worker suggested I make my own sparkline routine using a 1x1 CSS background image and varying the height. The problems are a) it is completely un-extensible in case we want to make changes; b) it seems hacky as hell (leaves about a bajillion DIVs per sparkline in the markup); and c) I have no idea if it will be fast enough when there are 100-200 of them on one page - what are your thoughts on the feasibility of the 1x1 sprite approach?
View 2 Replies
Mar 11, 2010
I had a situation on a dev server where all the ASP.Net applications we have started to fail at the same time.After some investigation we found that calls the app settings, in 1.1 apps, and the connection strings collection in 2.0 apps all failed. The config files had the values, but the code was returning null.After some head scratching and searching I thought that perhaps the root web.config was being used and the sites one ignored. To test out this theory I added the app settings required for one of the sites to the root web.config. This allowed the site to work.
View 1 Replies
Jun 21, 2010
I am trying to get ckeditor working on my site (having successfully used in on previous sites in the past).I have copied the ckeditor (main download) folder to the root of my site and I have added the FCKeditor.Net_2.6.3 dll to my site (plus added it to
the toolbox). I have set the basepath to "~/ckeditor/" and when I view the page in a browser it tells me that the following file is missing.
http://localhost:80/Web1/ckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&Toolbar=Default
Does anyone know where I can find this file (as it is nowhere to be seen in the ckeditor_3.3.1 download, in fact I don't have a folder called "editor" at all)?
View 5 Replies
Jun 22, 2010
have a search on my site, in which search type and search word are in URL like this: /search/t-someword.htmly route for search:
routes.MapRoute("Search", "searchj/{type}-{word}.html", new { controller = "Search", action = "Index"}, new { type = @"[t,s,p]"});
Everything works fine but when I change string to do not show spaces that word like "some words" looks like "some-words" it doesn't work. With spaces it works
View 4 Replies
Jan 20, 2010
The theme I'm using is not working in Visual Web Developer, I have the following code in place:
<%@
Page
Theme="MyTheme"
Language="VB"
AutoEventWireup="false"
CodeFile="Default2.aspx.vb"
Inherits="Default2" %>
the theme is getting applied to the live site.
View 3 Replies
May 3, 2010
I have one strange issue on SQL Reporting Services admin website (like URL). I am System Administrator as well as the content manager of this site. Under the Contents tab, the links
New Data Source and Upload File is redirecting to https:// site(secured site) which always fail to load. But the links for the New Folder and Report Builder are working fine and redirects to http:// site. I repaired the installation of SQL Server also but there is a same problem.
View 4 Replies
Apr 26, 2010
This is CSS code
@font-face {
font-family: 'FuturaStdBook';
src: url('site/font-face/futurastd-medium-webfont.eot');
src: local('☺'), url('site/font-face/futurastd-medium-webfont.woff') format('woff'), url('site/font-face/futurastd-medium-webfont.ttf') format('truetype'), url('site/font-face/futurastd-medium-webfont.svg#webfont') format('svg');
font-weight: normal;
font-style: normal;
}
h2 {font-family:'FuturaStdBook', sans-serif}
Can it be related to mime type?
How can i ensure my path is right?
View 3 Replies
Jul 8, 2010
We moved our website from one production server to another production server. DNS propagation is not an issue here. Some users cannot login now and others can. Those that can login do not see the same menu items that they used to see prior to the move. It's like the profile provider is not working. I checked the web.config file and everything appears to be the same as it was before. Is there something else I forgot to move?
View 4 Replies
Apr 5, 2010
I have an asp.net that produces a Word document. I want to allow users to download the file to their local drive. I use a hyperlink to achieve this and it works fine from my development site. However, when the website is accessed from a non development machine, I am sent to the proper directory, but instead of the open/save/cancel dialog I am presented with a "Convert File" dialog. Any of the selected file types I select download unusable files. I think this has to do with office being installed on the local machine on which I am attempting the download. Is there any way I can simply download a file from a virtual file to my local drive?
View 2 Replies