I wasn't sure where to place, but the issue does seem to be related to Razor, so I'll put it here. I've been having a number of problems trying to get certain things to work. But one of the issues is that I could not get a surface controller to work from the Controllers folder; I could only get it to work as a separate DLL (an installed package). Even then, running under IIS, on the pages that I called Html.Action, I just got a page that said nothing but "Sorry, an error occurred while processing your request." When I ran the project locally using IIS express, however, the form did render, but when I called it, I did a postback I got a 404 (though it did redirect to the same page like it was supposed to).
However, none of those things are the main issue that I'm commenting on. I know I should have realized this a lot sooner, but obviously the reason why a controller within the project is not working is because I am unable to actually create a new build of the project, and this may also be related in some way to my other issues. When I try to build the project, the only page that gives me errors is _DevDatasetLayout.cshtml. They all seem to be related to the page not being a WebViewPage. Every time ViewBag, Url.Content, or Html.Partial (all of which are elements of WebViewPage) are called, I get an error. The strange thing is that *sometimes* these references act properly in the editor (in that they don't show blue error lines and intellisense works when I start typing in Url.Content or something like that) and I never have this issue on any other page.
EDIT: Okay, it looks like I just wasn't noticing that I was looking at two different pages...the errors *always* show up on the page, and it is the one in App_Plugins\Packages\DevDataset\Views\_DevDatasetLayout.cshtml
[url=http://golfclubde.com/New-2012-TaylorMade-RocketBallZ-RBZ-Driver-golf-4.html]new 2012 taylormade rocketballz rbz driver[/url] Another technological innovation presented in that driver can be the Adjustable Sole Technology enabling you to modify the face to be neutral, closed, or open determined by what you will need. This generates a considerable distinction between face and crown to aid you align the golf club quicker. [url=http://golfclubde.com/TaylorMade-Ghost-TM-110-Tour-Putter-golf-90.html]taylormade ghost tm-110 tour putter[/url] R11 Bags & Hat's it's almost all forthcoming! It's also fairly risk-free to say the Japanese Marketplace could be the very first to announce R11 Forged Golf irons and R11 TP Forged Irons. [url=http://golfclubde.com/Left-Handed-Callaway-X-24-Hot-Irons-golf-186.html]left handed callaway x-24 hot irons[/url] No more would be the balls just whitened search for plenty of yellow this season. Then you will find the clothing and shoe lines which will make PGA pros like Rickie Fowler look bland. [url=http://golfclubde.com/Ping-K15-Driver-golf-276.html]ping k15 driver[/url] Having the proper golf club length is a key ingredient to being able to make a good golf swing.k15 driver Clubs that are too short or too long will hinder your ability to rotate and properly transfer your weight during the swing. It could also cause you to ground the club too early if they are too long or top the ball if they are too short. [url=http://golfclubde.com/Mizuno-MP-63-Iron-Set-golf-335.html]mizuno mp-63 iron set[/url] These drivers have been completely utilized because of a assortment associated with specialists nevertheless they acquired various competitions, including Annika Sorenstam and additionally Phil Michelson. ----------------------------
Okay, well, bots are always helpful, but I don't play golf...so, moving on...
I figured out what the problem was and this was apparently a problem underlying all of my previous ones. I had opened up Umbraco as a web site in visual studio rather than creating a solution for it. I tried it as a web application using a solution, and it all worked. That's probably something that should have been obvious to me before, so sorry for wasting time with stupid questions ;)
But, now I have another problem. It's probably also related to something equally stupid, and I'm probably going to wind up answering it again before somebody else does, but I might as well say it: My form is posting back now to the proper method on my controller, but it's not posting back the model(all of the fields are null).
My method is as follows:
[HttpPost] public ActionResult processFormData(Contact model) { //processing logic }
Contact is a simple object that I placed in the Models directory.
I'm rendering the view using a shared view, rendered using Html.Action, which uses Html.BeginUmbracoForm with the name of my controller and the method to post to. At the top I have
Cannot build project
I wasn't sure where to place, but the issue does seem to be related to Razor, so I'll put it here. I've been having a number of problems trying to get certain things to work. But one of the issues is that I could not get a surface controller to work from the Controllers folder; I could only get it to work as a separate DLL (an installed package). Even then, running under IIS, on the pages that I called Html.Action, I just got a page that said nothing but "Sorry, an error occurred while processing your request." When I ran the project locally using IIS express, however, the form did render, but when I called it, I did a postback I got a 404 (though it did redirect to the same page like it was supposed to).
However, none of those things are the main issue that I'm commenting on. I know I should have realized this a lot sooner, but obviously the reason why a controller within the project is not working is because I am unable to actually create a new build of the project, and this may also be related in some way to my other issues. When I try to build the project, the only page that gives me errors is _DevDatasetLayout.cshtml. They all seem to be related to the page not being a WebViewPage. Every time ViewBag, Url.Content, or Html.Partial (all of which are elements of WebViewPage) are called, I get an error. The strange thing is that *sometimes* these references act properly in the editor (in that they don't show blue error lines and intellisense works when I start typing in Url.Content or something like that) and I never have this issue on any other page.
EDIT: Okay, it looks like I just wasn't noticing that I was looking at two different pages...the errors *always* show up on the page, and it is the one in App_Plugins\Packages\DevDataset\Views\_DevDatasetLayout.cshtml
(Aside: when I tried to edit my original post, I got an XSLT parsing error)
[url=http://golfclubde.com/New-2012-TaylorMade-RocketBallZ-RBZ-Driver-golf-4.html]new 2012 taylormade rocketballz rbz driver[/url] Another technological innovation presented in that driver can be the Adjustable Sole Technology enabling you to modify the face to be neutral, closed, or open determined by what you will need. This generates a considerable distinction between face and crown to aid you align the golf club quicker. [url=http://golfclubde.com/TaylorMade-Ghost-TM-110-Tour-Putter-golf-90.html]taylormade ghost tm-110 tour putter[/url] R11 Bags & Hat's it's almost all forthcoming! It's also fairly risk-free to say the Japanese Marketplace could be the very first to announce R11 Forged Golf irons and R11 TP Forged Irons. [url=http://golfclubde.com/Left-Handed-Callaway-X-24-Hot-Irons-golf-186.html]left handed callaway x-24 hot irons[/url] No more would be the balls just whitened search for plenty of yellow this season. Then you will find the clothing and shoe lines which will make PGA pros like Rickie Fowler look bland. [url=http://golfclubde.com/Ping-K15-Driver-golf-276.html]ping k15 driver[/url] Having the proper golf club length is a key ingredient to being able to make a good golf swing.k15 driver Clubs that are too short or too long will hinder your ability to rotate and properly transfer your weight during the swing. It could also cause you to ground the club too early if they are too long or top the ball if they are too short. [url=http://golfclubde.com/Mizuno-MP-63-Iron-Set-golf-335.html]mizuno mp-63 iron set[/url] These drivers have been completely utilized because of a assortment associated with specialists nevertheless they acquired various competitions, including Annika Sorenstam and additionally Phil Michelson.
----------------------------
[url=http://www.golfclubde.com/]TaylorMade R11s Driver[/url]
[url=http://www.golfclubde.com/]Callaway X-24 Irons[/url]
Okay, well, bots are always helpful, but I don't play golf...so, moving on...
I figured out what the problem was and this was apparently a problem underlying all of my previous ones. I had opened up Umbraco as a web site in visual studio rather than creating a solution for it. I tried it as a web application using a solution, and it all worked. That's probably something that should have been obvious to me before, so sorry for wasting time with stupid questions ;)
But, now I have another problem. It's probably also related to something equally stupid, and I'm probably going to wind up answering it again before somebody else does, but I might as well say it: My form is posting back now to the proper method on my controller, but it's not posting back the model(all of the fields are null).
My method is as follows:
[HttpPost]
public ActionResult processFormData(Contact model)
{
//processing logic
}
Contact is a simple object that I placed in the Models directory.
I'm rendering the view using a shared view, rendered using Html.Action, which uses Html.BeginUmbracoForm with the name of my controller and the method to post to. At the top I have
@inherits System.Web.Mvc.WebViewPage<MyProject.Model.Contact>
is working on a reply...