This project is read-only.

MVC Example Preview issues

Topics: Developer Forum
Feb 6, 2009 at 11:09 PM

Hi

I’ve only just stumbled upon this project I’m well impressed with what I’ve seen especially after reading about the architecture of the solution.

We are already heavily invested in ASP.NET MVC though and I’ve installed the solution on a number of machines with the same results.

Neither the preview or save without publishing features seem to work “out of the box” in the MVC example.

If I choose to preview rather than save and publish I get the following:

 

[HttpException (0x80004005): Control 'ctl00_ctl08' of type 'LinkButton' must be placed inside a form tag with runat=server.]

   System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +8686387

   System.Web.UI.WebControls.LinkButton.AddAttributesToRender(HtmlTextWriter writer) +39

 Furthermore the item I tried to preview is then no longer editable with:

[NullReferenceException: Object reference not set to an instance of an object.]

   N2.Web.PathData.get_RewrittenUrl() +55

   N2.Edit.EditManager.GetEditExistingItemUrl(ContentItem item) +60

   N2.Edit.Edit.DisplayThisHasNewerVersionInfo(ContentItem itemToLink) +36

   N2.Edit.Edit.CheckRelatedVersions(ContentItem item) +368

   N2.Edit.Edit.OnPreRender(EventArgs e) +31

   System.Web.UI.Control.PreRenderRecursiveInternal() +80

   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

Also saving without publishing produces the same error as above.

At a cursory glance I didn’t see any bug reporting the above but it’s such an obvious I’m hoping it’s just something I haven’t done correctly.

I must admit I haven’t even attempted to debug these issues myself. We’re very keen to invest effort in this but would like to know we can start with a stable base and we’re only interested in an MVC solution.

In any case well done!

Feb 7, 2009 at 11:14 AM
Hi there -- Had and fixed the same issue.  See here:  http://www.codeplex.com/n2/WorkItem/View.aspx?WorkItemId=20468
Feb 8, 2009 at 8:56 AM
Thanks, that does fix the second error but not the first.

The Preview error is still there (LinkButton control). I'm guessing this a legacy from the ASP.NET forms-based solution?
Feb 8, 2009 at 12:00 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.