tags:

views:

52

answers:

1

so I have a form using typical Ajax.BeginForm inside a typical partial view (say T.ascx).

now I am adding validtion errors to Model using

 catch (RulesException ex)
        {
             ex.AddModelStateErrors(ModelState, "Upload");
             return PartialView("T.ascx"); 
        }

this was working fine and the user control was clearly reflecting what was causing the validation error.

Now, I want it to be a part of the page. Now, you would tell me that go ahead and add a page and reference this control as RenderAction or RenderPartial, but the page would not have anything else apart from this, so it feels odd for me to want to add an aspx page just that I can use a control. I am sure there is a better way.

EDIT: It feels odd because the only purpose page would serve is reference the user control. Is there a better way? Like to serve ascx as a page itself (but using the master page).

A: 

Your partial view won't be referencing your master page file, even if it was possible to render it without any regular view.

I don't see a problem with having a view that just renders a partial view.

çağdaş