Aug 22, 2013, 7:58 AM
Dynamic controls in asp.net mvc (cshtml)
Hi there,
I see following code in one of the thread for asp.net webforms.
public void BeforeRender()
{
this.Controls.Add(new Ext.Net.Panel { Title = "Item 1" });
this.Controls.Add(new Ext.Net.Panel { Title = "Item 2" });
this.Controls.Add(new Ext.Net.Panel { Title = "Item 3" });
X.Js.AddScript("alert('Hello from BeforeRender!');");
}
How to do the same in asp.net mvc ? My question is, how would I use ext.net control objects to create a control in asp.net mvc instead of forming a dynamic string for cshtml ?
Could you please help me on this ?
Thanks
Venu
I see following code in one of the thread for asp.net webforms.
public void BeforeRender()
{
this.Controls.Add(new Ext.Net.Panel { Title = "Item 1" });
this.Controls.Add(new Ext.Net.Panel { Title = "Item 2" });
this.Controls.Add(new Ext.Net.Panel { Title = "Item 3" });
X.Js.AddScript("alert('Hello from BeforeRender!');");
}
How to do the same in asp.net mvc ? My question is, how would I use ext.net control objects to create a control in asp.net mvc instead of forming a dynamic string for cshtml ?
Could you please help me on this ?
Thanks
Venu