Custom Server Controls :: ".ascx" Is Not A Valid Virtual Path?
Jan 25, 2010
I am trying to create a templete for an outside vendor (who will be hosting that section) that is going to be doing a portion of our website. I need to give reference to our header and footer for the outside vendor to reference. I am getting the following error.Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.Parser Error Message: 'http://www..mywebsite.com/CorporateHeadLinks.ascx' is not a valid virtual path.Here is the line of code that is creating the error:<%@ Register Src="http://www.mywebsite.com/CorporateHeadLinks.ascx" TagName="HLinks" TagPrefix="HeadLinks" %>When I go to the url I get404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.The file does exist. I am assuming the 404 error has to do with the ascx page not having opening and closing html tags. The page is referenced in our locally hosted pages as follows and works fine.
I have made subdirectory [URL]. and user control is loaded at runtime. But there is this error The virtual path '/theme/miragetheme/user-controls/display-userblog.ascx' maps to another application, which is not allowed.
I have created a setup for my application which is having both website and desktop application. i m supposed to changes connection string in both the config files at runtime. i used following code :
I've got a project that's going to go on a dedicated server environment. I'll be uploading images to the server, but saving them outside of the virtual folder path of the actual website, like so:
Now, this works fine on my home computer. Is there anything I'll need to do with IIS or ASP.NET (possibly in web.config) for this to work properly on a production machine? Settings or permissions that may need changing?...
It will be on Window 2003 with IIS6 and ASP.NET 3.5 SP1.
Over here I have created a folder with name Data inside my solution, so the Server.Mappath("Data") as well the statemet for converting assigning the src property of the IFrame I1 is working properly. But I want to use the files from a folder which resides in a network folder like
I am trying to upload a file Into a MapPath but I am getting a error 'C:/WebSite/userimages/' is a physical path, but a virtual path was expected. My code is:
I am trying to convert the virtual path to a physical path but don't seem to have Server.MapPath or HttpServerUtility.MapPath available in my handler. I add the System.Web namespace with no luck.
I'm creating a custom server control which needs to take in a root-relative path for one of it's properties. I use the UrlProperty, but when I select a file in the markup, the selected path doesn't inlcude the the "~/". I'd like to mimic the behavior of a hyperlink. So let's say I have this:
<asp:HyperLink ID="HyperLink1" NavigateUrl
When I type in an equals sign after the NavigateUrl property, intellisense pops open a URL picker and I can pick from any page to produce this code:
I have some user controls registered in the web.config.
Now I need to load some of them dynamiclly with the page.loadcontrol() function. This function needs a virtual path to the .ascx file. Is it possible to get this virtual path (that is the same as the source path in the config) by the tagname?
I have an user control that reads the data from app_data folder and does some processing.In design time I'd like to show the row data in control placeholder (using GetDesignTimeHtml).To do that I need to figure out the absolute path to app_data folder on my project.The HttpContext is not available and HostingEnvironment.MapPath returns null.
Is there any asp.net flash control which will work on client side without installing flash plugin.Actually i was using flashcontrol in my project and thereby displayed swf movie in my project . It was working right on server because flash player and flash plugin were installed on it. But when i tried to access that page on client side it doesnot showany movie or image
I want to run my new web application with forms authentication under the ASP.NET Development WebServer (Cassini), but not at site root "/" (rather, at the path it will reside in production; "/New").However, the build process gives the error:
"It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.This error can be caused by a virtual directory not being configured as an application in IIS. New.MvcWebobjdebugcsautoparameterizeoriginalweb.config"
Now, I understand what it is saying.I have forms authentication enabled in my web.config in a virtual directory.The error goes away when I remove the web.config, or remove the "virtual path: /New" debugger configuration, or move debugging from Cassini to IIS and manually create an application at "/New".
But it is only a 'virtual' directory in the mind of the Build System. The path IS application-enabled in a production IIS setting. Also, if I remove the web.config, Cassini will happily publish "http://localhost/New" as an application (for example, Server.MapPath("~") returns my project directory without the "/New" suffix); however I need forms authentication (an application-level web.config parameter) enabled in it.How I can avoid this build error while retaining my desired features?
The project is currently configured for "file-system" site development. This and Cassini are supposed to make it easier for my content creators to participate in development and testing with their local copy of VS2010, without having to install IIS on their Windows PCs. I will also one-click publish to my local IIS for testing, then package/publish/deploy to public test, then finally publish to production. In my mind I imagine Cassini being a very helpful part of this whole process.
VS2010, MVC application, file-system site project
Project Settings: * ASP.NET 4.0 * Use Visual Studio Development Server * Virtual Path: /New
Quick question. When updating aspx.cs files on a virtual dedicated server does it require a restart of the virtual server for the changes to take effect?
Warning 1 C:UsersBillDocumentsMy Web SitesNausetNewcomersIncludesUtilsToolsWebAdminUsers.aspx: ASP.NET runtime error: Failed to map the path '/Includes/Utils/Controls/alphalinks.ascx'. C:UsersBillDocumentsMy Web SitesNausetNewcomersIncludesUtilsToolsWebAdminUsers.aspx 1 1 C:...NausetNewcomers
This warning is in error as the file is in the structure where it is supposed to be, what is the problem?
I am new to asp.net and trying to build a top level in asp.net. Actually i want to save .aspx pages in sql server database and excute directly from the database. I search a lot and come to know about VirtualPathprovider class. It is helpful in building cms like what i want but the problem is that i am quite unable to understand the use of this class.
My basic question is, can a virtual directory in IIS point to a physical path that's not on the local machine? For instance, right now I have a virtual path /NaturalGasReport/NYMEX which points to physical path C:Program Files (x86)NymexSettleNATGAS_REPORTNYMEX, but I want it to point to a physical path on a difference PC on the same network. Is this possible? (I know I can just try it out so I apologize for asking but I thought it would be best to get an explanation along with "yes" or "no"). If you want more detail, this is what I need to do. To make a long story short, because of a vendor product we are using that won't run on a 64-bit operating system, I have to run a program called Generate_NGReportData.vbs (it's a vbscript program) on a PC I will call 28. It uses a vendor product which produces jpg files which are graphs of the Natural Gas market. The machine where I wish it could run is called RTEST01 but this machine runs a 64-bit OS and the components won't work there. RTEST01 has the databases. So, I created a datasource on 28 which points to RTEST01's database. The vbs program will read the data, generate the reports, and write one row to a database table on RTEST01. RTEST01 has to run the complimentary program which sends these reports (via email). 28 is not an email server so it can't email the reports. So on RTEST01 I will run Send_NaturalGasReport.vbs. This program creates an email body of html. The html references [URL]NaturalGasReport/NYMEX/" & Day(nymex_update_dt) & ".jpg which is a virtual directory pointing to C:Program Files (x86)NymexSettleNATGAS_REPORTNYMEX. I need it to point to the folder and files on 28.So if my initial question has a simple yes answer then I am all set. If not, examine my architecture and propose an alternative solution.
OK, I've seen a lot of ambiguous errors, but this was is in the top 20 or so. I have a RenderPartial that looks like this:
[Code]....
When the view loads, I get this error:
The relative virtual path '~Areas/User/Views/Shared/ProjectStats.ascx' is not allowed here. That really helps. Why isn't it allowed there? What's wrong with it? Just above it I have other PartialRender calls that work without a problem. They're created exactly the same way. Here's another:
[Code]....
This works fine. I thought maybe it was due to accessing a view from another Area, but I added a partial view to that Area's folder and it still didn't work.
I have successfully created my own virtual path provider to load a user control embedded in an assembly. The problem I am facing is I cannot use any embedded string resource in MyUserControl.ascx:
This will cause IIS to throw a compilation exception at runtime saying the resource SR.Welcome is not found. I guess ASP.NET runtime looks for the string resource SR in the main assembly instead of the one that contains my user control.
To start with then we have a LinkButton whose text is actually an image tag. The image it links to is a Png and resides in a folder in the web directory. This is IIS V6 and win Server 2003.
The path is [URL]
Admin is a virtual directory configured in IIS.
The above url doesn't work but if you change it to [URL] (lowers case 'a') then the image is served, change it back to 'A' and it takes you to login, you log in and it loops back to log in. change to 'a' and voila the image is served. Weirdly this problem doesn't always occur and I have hunted for a resolution for days to no avail.
I am trying to profile the number of "Anonymous Requests" for an ASP.NET web application using perfmon. When I select this key, I have to pick a process of the form _LM_W3SVC_#_ROOT. How do I map the IIS metabase path back to the web application?
I created a virtual directory in the Visual Web Developer, according to this post:
[URL]
I want the user to upload / download documents in the mvc app to that virtual directory. When a document is uploaded, I'm specifying the path to the document to be stored for later retrieval like so:
~/VirtualDirectoryName/FileContent.docx. But when I try to open that as a link in th app,using ResolveUrl, it appends the port number after localhost like so,[URL], I get a document not found, since it really should be, [URL].