Apr 17, 2013, 1:38 PM
can a view use two model
I have a view which is the result of partial view result.
I have a view view 1 as follows
I need to display the data from model of partial view into the above text fiel with id "viewdata" while other elements of the form will be using @model Core.Framework.modeldata
Is there a way to do something like this as i am stuck with it
public virtual ActionResult showview1(string containerId,string data)
{
return new PartialViewResult
{
ContainerId = containerId,
RenderMode = RenderMode.AddTo,
ViewName = "../something/view1",
WrapByScriptTag = false,
Model=data
};
}
I have a view view 1 as follows
@model Core.Framework.modeldata
@(Html.X().Window()
.Width(325)
.Height(325)
.Modal(true)
//.Layout(LayoutType.Card)
.Closable(true)
.Items(item => item.Add(
Html.X().FormPanel()
.ID("form1")
.Icon(Icon.User)
.Frame(true)
.BodyPadding(6)
.Defaults(d =>
{
d.Add(new Parameter("LabelWidth", "90"));
})
.FieldDefaults(def =>
{
def.MsgTarget = MessageTarget.Side;
})
.Width(500)
.DefaultAnchor("100%")
.FieldDefaults(d =>
{
d.LabelAlign = LabelAlign.Right;
})
.Items(
Html.X().TextField().FieldLabel("Domain Restriction Id").ID("viewdata").ReadOnly(true),
I need to display the data from model of partial view into the above text fiel with id "viewdata" while other elements of the form will be using @model Core.Framework.modeldata
Is there a way to do something like this as i am stuck with it