473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

"Failed to map the path" - error on first visit

hi,

I have a repeater which dynamically loads another usercontrol throught
databinding:

OnClick: DataBind()

rptProduct_ItemDataBound: ViewSmall _viewSmall = (ViewSmall)
LoadControl("ViewSmall.ascx");

The two UserControls are in the same directory on the server.
The webroot for this application is c:\inetpub\wwwroot\joa\InfoCenter\Test
and the usercontrols are placed in
c:\inetpub\wwwroot\joa\InfoCenter\Test\DesktopModu les\Csite.Product\ViewSmal
l.ascx

I get this error the first time I click this button after recompiling my
project - but only the first; all subsequent clicks, reload or whatever,
finds the UserControl and displays everything correctly:
Failed to map the path
'/InfoCenter/Test/DesktopModules/Csite.Product/ViewSmall.ascx'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Failed to map the path
'/InfoCenter/Test/DesktopModules/Csite.Product/ViewSmall.ascx'.

Source Error:

Line 265: {
Line 266: PlaceHolder phProduct =
(PlaceHolder)e.Item.FindControl("phProduct");
Line 267: ViewSmall _viewSmall = (ViewSmall)
LoadControl("ViewSmall.ascx");
Line 268: InfoProductRow product = (InfoProductRow)e.Item.DataItem;
Line 269: _viewSmall.Product = product;

Source File:
c:\inetpub\wwwroot\joa\infocenter\test\desktopmodu les\csite.product\viewlist
..ascx.cs Line: 267

Stack Trace:

[HttpException (0x80004005): Failed to map the path
'/InfoCenter/Test/DesktopModules/Csite.Product/ViewSmall.ascx'.]

System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6 .MapPathSlowUsingIISCore(S
tring path) +197
System.Web.Hosting.ISAPIWorkerRequest.MapPath(Stri ng path) +419
System.Web.HttpRequest.MapPath(String virtualPath, String baseVirtualDir,
Boolean allowCrossAppMapping) +254
System.Web.UI.TemplateControlParser.CompileAndGetP arserCacheItem(String
virtualPath, String inputFile, HttpContext context) +99
System.Web.UI.TemplateControlParser.GetCompiledTyp e(String virtualPath,
String inputFile, HttpContext context) +12
System.Web.UI.UserControlParser.GetCompiledUserCon trolType(String
virtualPath, String inputFile, HttpContext context) +176
System.Web.UI.TemplateControl.LoadControl(String virtualPath) +41
Csite.InfoCenter.Product.List.rptProduct_ItemDataB ound(Object sender,
RepeaterItemEventArgs e) in
c:\inetpub\wwwroot\joa\infocenter\test\desktopmodu les\csite.product\viewlist
..ascx.cs:267
System.Web.UI.WebControls.Repeater.OnItemDataBound (RepeaterItemEventArgs
e) +110
System.Web.UI.WebControls.Repeater.CreateItem(Int3 2 itemIndex,
ListItemType itemType, Boolean dataBind, Object dataItem) +139
System.Web.UI.WebControls.Repeater.CreateControlHi erarchy(Boolean
useDataSource) +475
System.Web.UI.WebControls.Repeater.OnDataBinding(E ventArgs e) +49
System.Web.UI.WebControls.Repeater.DataBind() +23
Csite.InfoCenter.Product.List.rptProducts_ItemData Bound(Object sender,
RepeaterItemEventArgs e) in
c:\inetpub\wwwroot\joa\infocenter\test\desktopmodu les\csite.product\viewlist
..ascx.cs:260
System.Web.UI.WebControls.Repeater.OnItemDataBound (RepeaterItemEventArgs
e) +110
System.Web.UI.WebControls.Repeater.CreateItem(Int3 2 itemIndex,
ListItemType itemType, Boolean dataBind, Object dataItem) +139
System.Web.UI.WebControls.Repeater.CreateControlHi erarchy(Boolean
useDataSource) +475
System.Web.UI.WebControls.Repeater.OnDataBinding(E ventArgs e) +49
System.Web.UI.WebControls.Repeater.DataBind() +23
Csite.InfoCenter.Product.List.DataBind(Object[] objectArray) in
c:\inetpub\wwwroot\joa\infocenter\test\desktopmodu les\csite.product\viewlist
..ascx.cs:190
Csite.InfoCenter.Product.List.GetSearchData(InfoCe nterDB db, Guid
guidSortiment, Guid guidManufacturer, SearchType searchType, String
searchData, Int32 pageIndex) in
c:\inetpub\wwwroot\joa\infocenter\test\desktopmodu les\csite.product\viewlist
..ascx.cs:135
Csite.InfoCenter.Product.List.InitProductList() in
c:\inetpub\wwwroot\joa\infocenter\test\desktopmodu les\csite.product\viewlist
..ascx.cs:47
Csite.InfoCenter.Product.List.OnProductSearch(Obje ct sender, Sortiment
sortiment, SearchType searchType, String searchData) in
c:\inetpub\wwwroot\joa\infocenter\test\desktopmodu les\csite.product\viewlist
..ascx.cs:277
Csite.InfoCenter.ProductHandler.OnSearchEventHandl er.Invoke(Object
sender, Sortiment sortiment, SearchType searchType, String searchData) +0
Csite.InfoCenter.ProductHandler.SearchEvents.OnSea rch(Object sender,
Sortiment sortiment, SearchType searchType, String searchData) in
C:\Inetpub\wwwroot\joa\InfoCenter\InfoCenter\Csite .EventHandler\Events.cs:12
8
Csite.InfoCenter.Product.Search_postback.Search(Ob ject sender,
CommandEventArgs e) in
c:\inetpub\wwwroot\joa\infocenter\Test\DesktopModu les\Csite.Product\Search_p
ostback.ascx.cs:71
System.Web.UI.WebControls.Button.OnCommand(Command EventArgs e) +110

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
stBackEvent(String eventArgument) +115
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277

Can you help me?

regards,
Jonas
Nov 18 '05 #1
1 4195
Hi Jonas,

From your description, you're dynamically load one Usercontrol in a
webpage's repeater control's databinding event , but you got "Failed to map
the path" error every the first time you fire the databinding, yes?

After viewing the error info and call stack you provided, I'm also feeling
very strange since the absolute path asp.net is locating the control is
correct according to your description. That's the
'/InfoCenter/Test/DesktopModules/Csite.Product/ViewSmall.ascx'
and /InfoCenter should be the site root ,yes?

And as to narrow down the problem, I think we can try performing the
following test:
1. Create a new simple page and load the Usercontrol dynamically to see
whether there has the same problem.

2. If #1 hasn't any problem, try adding a repeater or datalist and
dynamically load the control in the template databound control's
databinding event to see whether the problom will occur.

In addition, based on searching in the former issues , there is some issue
mentioned that sometimes when the usercontrol's ascx templatefile is
locked by something it will popup "failed to map the path" error. So we can
also have a check to see whether there're any other programs which may lock
the usercontorl file.

If you have any other findings, please also feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Alpha | last post by:
I use FolderBrowserDlg for user to select a folder path then store it in the sql table. I then retrieve it to concatenate in a sqlcommand text to retrive files from that directory but it won't...
1
by: Steve Grahovac | last post by:
I have been having trouble the last few days opening any ASP.NET web forms in the design view in the designer. Every time I clicked on an aspx file I got a message box with the error "Unable to...
0
by: dsh | last post by:
I have an ASP.NET web application running on a load-balanced Windows Server 2003 web farm running IIS 6.0, using Active Directory authentication. I'm trying to programmatically create a new...
1
by: John Dalberg | last post by:
Running Crystal Reports with the hotfixes and patches & VS 2003. I created a CR report on my development server which has SQL Server. The report runs fine inside Visual Studio. When I switched...
1
by: Roy | last post by:
Hey all, I have a VB App which uses the bundled version of Crystal Reports for VS.NET 2003. It works fine in when I run it using VS *but* when I deploy it anywhere (including the development PC...
0
by: awbacker | last post by:
Havin a problem with MapPath() failing on me. It doesn't do it right away, but at some point it dies and won't come back. I have to hiccup the app by poking IIS or a web.config/other critical...
2
by: Jeff_Mac | last post by:
Hi there. I'm a bit of a newbie, and I would appreciate any help that anyone can give me on an error I'm getting with Crystal Reports. Every time I attempt to view a report using the Crystal...
1
by: aaaaaa | last post by:
running a crystal (v10) reporting app on a virtual web server and getting the "Validation of viewstate MAC failed...." error when opening the crystal viewer. Any help please!!!
0
by: Radu | last post by:
Hi. I have finished a web-site - and it runs fine on my dev machine. I have deployed it onto the server, and now I have this (which, by the way, doesn't seem to happen all the time - sometimes I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.