|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Load User Control from different directoryI would like to create a user control, place it in a directory and use it for many different sites. The problem I am having is when I use the loadcontrol I get an error. The error states "The virtual path '/head/header.ascx' maps to another application, which is not allowed." This is because allowCrossAppMapping defaults to false in the HTTPRequest.MapPath that LoadControl uses. Is there a way that I can make the default for allowCrossAppMapping True instead of False? Or just set it in code each time I use it? Here is a bit of the stack trace: System.Web.HttpRequest.MapPath(String virtualPath, String baseVirtualDir, Boolean allowCrossAppMapping) System.Web.UI.BaseParser.MapPath(String path, Boolean allowCrossAppMapping) Any help on this would be appricated. Thanks in advance. Robin Create a virtual directory in your application which points to the controls
directory. -- Show quoteHide quoteStaff Consultant II Enterprise Web Services Cardinal Solutions Group Future Business Model Loan Origination Services National City Mortgage "Robin Yarnell" wrote: > Hello, > I would like to create a user control, place it in a directory and use > it for many different sites. The problem I am having is when I use the > loadcontrol I get an error. The error states "The virtual path > '/head/header.ascx' maps to another application, which is not allowed." This > is because allowCrossAppMapping defaults to false in the HTTPRequest.MapPath > that LoadControl uses. Is there a way that I can make the default for > allowCrossAppMapping True instead of False? Or just set it in code each time > I use it? > > Here is a bit of the stack trace: > System.Web.HttpRequest.MapPath(String virtualPath, String baseVirtualDir, > Boolean allowCrossAppMapping) > System.Web.UI.BaseParser.MapPath(String path, Boolean allowCrossAppMapping) > > Any help on this would be appricated. > > Thanks in advance. > > Robin > > Thanks for the response.
I tried that and I still get the same error "maps to another application, which is not allowed" any other ideas? Thanks, Robin Show quoteHide quote "Michael Baltic" wrote: > Create a virtual directory in your application which points to the controls > directory. > -- > Staff Consultant II > Enterprise Web Services > Cardinal Solutions Group > > Future Business Model > Loan Origination Services > National City Mortgage > > > "Robin Yarnell" wrote: > > > Hello, > > I would like to create a user control, place it in a directory and use > > it for many different sites. The problem I am having is when I use the > > loadcontrol I get an error. The error states "The virtual path > > '/head/header.ascx' maps to another application, which is not allowed." This > > is because allowCrossAppMapping defaults to false in the HTTPRequest.MapPath > > that LoadControl uses. Is there a way that I can make the default for > > allowCrossAppMapping True instead of False? Or just set it in code each time > > I use it? > > > > Here is a bit of the stack trace: > > System.Web.HttpRequest.MapPath(String virtualPath, String baseVirtualDir, > > Boolean allowCrossAppMapping) > > System.Web.UI.BaseParser.MapPath(String path, Boolean allowCrossAppMapping) > > > > Any help on this would be appricated. > > > > Thanks in advance. > > > > Robin > > > > Forget the last post. The virtual directory almost worked. Now I am getting
an error during the parser phase which states:"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." I looked at my IIS settings for the VD and everything seems to be set up right. Stack Trace also says: Line 37: by Microsoft that offers a single logon and core profile services for member sites. Line 38: --> Line 39: <authentication mode="Windows" /> Does anyone know how to fix this? Thanks, Robin Show quoteHide quote "Robin Yarnell" wrote: > Thanks for the response. > I tried that and I still get the same error "maps to another application, > which is not allowed" any other ideas? > > Thanks, > > Robin > > "Michael Baltic" wrote: > > > Create a virtual directory in your application which points to the controls > > directory. > > -- > > Staff Consultant II > > Enterprise Web Services > > Cardinal Solutions Group > > > > Future Business Model > > Loan Origination Services > > National City Mortgage > > > > > > "Robin Yarnell" wrote: > > > > > Hello, > > > I would like to create a user control, place it in a directory and use > > > it for many different sites. The problem I am having is when I use the > > > loadcontrol I get an error. The error states "The virtual path > > > '/head/header.ascx' maps to another application, which is not allowed." This > > > is because allowCrossAppMapping defaults to false in the HTTPRequest.MapPath > > > that LoadControl uses. Is there a way that I can make the default for > > > allowCrossAppMapping True instead of False? Or just set it in code each time > > > I use it? > > > > > > Here is a bit of the stack trace: > > > System.Web.HttpRequest.MapPath(String virtualPath, String baseVirtualDir, > > > Boolean allowCrossAppMapping) > > > System.Web.UI.BaseParser.MapPath(String path, Boolean allowCrossAppMapping) > > > > > > Any help on this would be appricated. > > > > > > Thanks in advance. > > > > > > Robin > > > > > > This works now thanks for your help.
Robin Show quoteHide quote "Robin Yarnell" wrote: > Forget the last post. The virtual directory almost worked. Now I am getting > an error during the parser phase which states:"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." I looked at my IIS settings for the VD > and everything seems to be set up right. > > Stack Trace also says: > Line 37: by Microsoft that offers a single logon and core profile > services for member sites. > Line 38: --> > Line 39: <authentication mode="Windows" /> > > Does anyone know how to fix this? > > Thanks, > > Robin > > "Robin Yarnell" wrote: > > > Thanks for the response. > > I tried that and I still get the same error "maps to another application, > > which is not allowed" any other ideas? > > > > Thanks, > > > > Robin > > > > "Michael Baltic" wrote: > > > > > Create a virtual directory in your application which points to the controls > > > directory. > > > -- > > > Staff Consultant II > > > Enterprise Web Services > > > Cardinal Solutions Group > > > > > > Future Business Model > > > Loan Origination Services > > > National City Mortgage > > > > > > > > > "Robin Yarnell" wrote: > > > > > > > Hello, > > > > I would like to create a user control, place it in a directory and use > > > > it for many different sites. The problem I am having is when I use the > > > > loadcontrol I get an error. The error states "The virtual path > > > > '/head/header.ascx' maps to another application, which is not allowed." This > > > > is because allowCrossAppMapping defaults to false in the HTTPRequest.MapPath > > > > that LoadControl uses. Is there a way that I can make the default for > > > > allowCrossAppMapping True instead of False? Or just set it in code each time > > > > I use it? > > > > > > > > Here is a bit of the stack trace: > > > > System.Web.HttpRequest.MapPath(String virtualPath, String baseVirtualDir, > > > > Boolean allowCrossAppMapping) > > > > System.Web.UI.BaseParser.MapPath(String path, Boolean allowCrossAppMapping) > > > > > > > > Any help on this would be appricated. > > > > > > > > Thanks in advance. > > > > > > > > Robin > > > > > > > >
Custom control: How to render an embedded image at design-time?
Render and Image on a Button I guess this can't be done can it ? Tool to monitor/trace all method calls? Webcontrol Designer Awareness... Re: accessibility and asp:button WinForm as ASP.NET custom control Dropdownlist headings Register directive for custom web control in VS 2005 Beta 2 accessing a specific cotrol from web DataGrid control. |
|||||||||||||||||||||||