Popup to a new page outside of Umbraco project from a UserControl
Currently I have a UserControl macroed into an Umbraco template that makes a popup call to an aspx page in abother project within the same solution as Umbraco. The error I receive back is as follows.
Page not found
No umbraco document matches the url 'http://localhost:49271/job-seekers/UserControls/Jobs/JobDetails.aspx?jobID=2996'
umbraco
tried this to match it using this xpath query'/root/*/* [@urlName =
"job-seekers"]/* [@urlName = "usercontrols"]/* [@urlName = "jobs"]/*
[@urlName = "jobdetails"]')
This page can be replaced with a
custom 404 page by adding the id of the umbraco document to show as 404
page in the /config/umbracoSettings.config file. Just add the id to the
'/settings/content/errors/error404' element.
Are you able to browse to that URL manually in your browser?
My guess is that you have the page stored in /usercontrols/ but your URL above is looking for /job-seekers/UserControls. You could fix that by adding a / in front of the href.
+1 on the suggestion of handling your .aspx pages in another folder than the usercontrols folder intended for Umbraco Macroes to avoid mixing things up.
It can quickly become a bit messy and by storing your content in a custom folder in the root level you should be able to add the reservedurl in the web.config without any further problems.
Thank you for your quick reply! I'm actually taking over on a project for another developer so this wasn't my initial design.
The hierarchy of the Projects is as follows. The containing folder (Project) has an Umbraco folder which holds the Umbraco project in a pretty standard setup but the added on files are in a UI folder at the same root level as Umbraco
Project
|_
| Umbraco
|
|_ UI
|_ UserControls
|_ Jobs
|_ JobDetails
The JobSearch user control is held within the usercontrols subfolder of the Umbraco folder (not shown in my poorly made diagram) which it is macroed to a template. I unfortunately am unable to see my page from the browser if I type the URL in manually which leads me to believe I have the extension incorrect given that there are 2 projects and that I'm running off of a macro within a template in Umbraco that's trying to point at an aspx page within a seperate project.
Hmm, not sure about your project structure but it really doesn't matter that much since it's just an ASPX page. If you look on the filesystem of the actual umbraco site, does /usercontrols/jobs/jobdetails.aspx exist?
Yes. jobdetails.aspx exists within the usercontrols folder in a compiled form.
When removing 'job-seekers' from the URL I receive the same error page
Page not found No umbraco document matches the url 'http://localhost:49271/UserControls/Jobs/JobDetails.aspx?jobID=2996' umbraco tried this to match it using this xpath query'/root/*/* [@urlName = "usercontrols"]/* [@urlName = "jobs"]/* [@urlName = "jobdetails"]') This page can be replaced with a custom 404 page by adding the id of the umbraco document to show as 404 page in the /config/umbracoSettings.config file. Just add the id to the '/settings/content/errors/error404' element. For more information, visit information about custom 404 on the umbraco website.
I was told by a coworker who had previously worked on the project prior to it being split into 4 projects that the jobdetails link use to work fine prior to the split. To be honest I'm very new to Umbraco so I'm not entirely sure of how the engine works quite yet but I feel that there must be something wrong with this section of the code. Both folder trees in both applications have UserControls/Jobs/ however in the root of Umbraco it technically follows usercontrols/UserControls/Jobs
Given that structure and the reservedURL of ~/ODD.WorkingEd.Web.UI/UserControls/Jobs/JobDetails.aspx doesn't seem to be blocking Umbraco as well as using the path UserControls/Jobs/JobDetails.aspx?jobID=2996 doesn't allow for a manual view of my file in the UI project I feel that there is something wrong with the pathing that I'm overlooking
Good news is at least the page functions correctly so the problem goes back to How do I reference it from outside of the Umbraco project? Or is it too much of a hassle to deal with and I should try to convince my boss to allow me to redo the structure of the projects.
We decided to take the easy route and move all the pages into the folder I made at the root level of the Umbraco project and to scrap the other project. Thanks for all your help!
Popup to a new page outside of Umbraco project from a UserControl
Currently I have a UserControl macroed into an Umbraco template that makes a popup call to an aspx page in abother project within the same solution as Umbraco. The error I receive back is as follows.
Page not found
No umbraco document matches the url 'http://localhost:49271/job-seekers/UserControls/Jobs/JobDetails.aspx?jobID=2996'
umbraco tried this to match it using this xpath query'/root/*/* [@urlName = "job-seekers"]/* [@urlName = "usercontrols"]/* [@urlName = "jobs"]/* [@urlName = "jobdetails"]')
This page can be replaced with a custom 404 page by adding the id of the umbraco document to show as 404 page in the /config/umbracoSettings.config file. Just add the id to the '/settings/content/errors/error404' element.
For more information, visit information about custom 404 on the umbraco website.
The version of Umbraco we are currently using is v 4.7.1
The call used within the usercontrol goes as follows
<a class="popup" href='<%# "UserControls/Jobs/JobDetails.aspx?jobID=" + DataBinder.Eval(Container.DataItem,"jobID") %>'>Details</a>
I've tried numerous entries within the web.config to resolve this issue. Such as adding the following values to the umbracoReservedUrls tag.
~/ODD.WorkingEd.Web.UI/UserControls/Jobs/JobDetails.aspx
~/UserControls/Jobs/JobDetails.aspx
~/~I/UserControls/Jobs/JobDetails.aspx
each pretty much was met with blinding failure. Is there something I'm just not getting??
Hi Jon,
Are you able to browse to that URL manually in your browser?
My guess is that you have the page stored in /usercontrols/ but your URL above is looking for /job-seekers/UserControls. You could fix that by adding a / in front of the href.
Also I guess it doesn't matter but I might reccomend using a different directory for your aspx pages.
-Tom
+1 on the suggestion of handling your .aspx pages in another folder than the usercontrols folder intended for Umbraco Macroes to avoid mixing things up.
It can quickly become a bit messy and by storing your content in a custom folder in the root level you should be able to add the reservedurl in the web.config without any further problems.
/Jan
Hi Tom,
Thank you for your quick reply! I'm actually taking over on a project for another developer so this wasn't my initial design.
The hierarchy of the Projects is as follows. The containing folder (Project) has an Umbraco folder which holds the Umbraco project in a pretty standard setup but the added on files are in a UI folder at the same root level as Umbraco
Project
|_
| Umbraco
|
|_ UI
|_ UserControls
|_ Jobs
|_ JobDetails
The JobSearch user control is held within the usercontrols subfolder of the Umbraco folder (not shown in my poorly made diagram) which it is macroed to a template. I unfortunately am unable to see my page from the browser if I type the URL in manually which leads me to believe I have the extension incorrect given that there are 2 projects and that I'm running off of a macro within a template in Umbraco that's trying to point at an aspx page within a seperate project.
Hmm, not sure about your project structure but it really doesn't matter that much since it's just an ASPX page. If you look on the filesystem of the actual umbraco site, does /usercontrols/jobs/jobdetails.aspx exist?
Can you browse to the URL above without the 'job-seekers'? http://localhost:49271/UserControls/Jobs/JobDetails.aspx?jobID=2996
Yes. jobdetails.aspx exists within the usercontrols folder in a compiled form.
When removing 'job-seekers' from the URL I receive the same error page
Page not found No umbraco document matches the url 'http://localhost:49271/UserControls/Jobs/JobDetails.aspx?jobID=2996' umbraco tried this to match it using this xpath query'/root/*/* [@urlName = "usercontrols"]/* [@urlName = "jobs"]/* [@urlName = "jobdetails"]') This page can be replaced with a custom 404 page by adding the id of the umbraco document to show as 404 page in the /config/umbracoSettings.config file. Just add the id to the '/settings/content/errors/error404' element. For more information, visit information about custom 404 on the umbraco website.
I was told by a coworker who had previously worked on the project prior to it being split into 4 projects that the jobdetails link use to work fine prior to the split. To be honest I'm very new to Umbraco so I'm not entirely sure of how the engine works quite yet but I feel that there must be something wrong with this section of the code. Both folder trees in both applications have UserControls/Jobs/ however in the root of Umbraco it technically follows usercontrols/UserControls/Jobs
<ItemTemplate>
<a class="popup" href='<%# "UserControls/Jobs/JobDetails.aspx?jobID=" + DataBinder.Eval(Container.DataItem,"jobID") %>'>Details</a>
</ItemTemplate>
Given that structure and the reservedURL of ~/ODD.WorkingEd.Web.UI/UserControls/Jobs/JobDetails.aspx doesn't seem to be blocking Umbraco as well as using the path UserControls/Jobs/JobDetails.aspx?jobID=2996 doesn't allow for a manual view of my file in the UI project I feel that there is something wrong with the pathing that I'm overlooking
Ok so I made a folder at the root level of umbraco called Testing.
By blocking out the Testing folder on reservedURLs and using this URL I am able to finally see the JobDetails page.
http://localhost:49271/Testing/JobDetails.aspx?jobID=2998
Good news is at least the page functions correctly so the problem goes back to How do I reference it from outside of the Umbraco project? Or is it too much of a hassle to deal with and I should try to convince my boss to allow me to redo the structure of the projects.
It might also be important to note that
http://localhost:49271/Testing/JobDetails.aspx?jobID=2998
may work however when I changed the string to"Testing/JobDetails.aspx?jobID=" + DataBinder.Eval(Container.DataItem,"jobID")
I was met with the following pathhttp://localhost:49271/job-seekers/Testing/JobDetails.aspx?jobID=2995
which as you can guess is broken. I tried to make the path relative to roll it up a folder but it keeps converting the relative paths into literalshttp://localhost:49271/job-seekers/~/Testing/JobDetails.aspx?jobID=2995
We decided to take the easy route and move all the pages into the folder I made at the root level of the Umbraco project and to scrap the other project. Thanks for all your help!
is working on a reply...