DataModel model1 = new DataModel();
DataItem item1 = new DataItem();
item1.Name = "地址"
item1.PropType = "Text";
DataItem item2 = new DataItem();
item2.Name = "介绍"
item2.PropType = "MultilineText";
item3.PropType = "RichText";
----------
<p></p>
----------
model1.AddItem(item1);
model1.AddItem(item2);
-----------------------------------------
Board board1 = new Board();
board1.DataModel = model1;
Article article = .. ;
article.Board = board1
DataModel dm = article.Board.DataModel;
foreach(DataItem item in dm.Items)
{
item.PropType
this.placeHolder.Controls.Add();
}
---------------------------------------
save:
ArrayList properties = new ArrayList();
foreach(DataItem item in dm.Items)
{
item.Name
this.placeHolder.Controls.FindControl(.);
Property prop = new Property();
prop.Name = item.Name;
prop.Value = ;
properties.Add(prop);
}
string ContentProperties = properties.Serialize();
---------------
ArrayList properties = new ArrayList();
--------------------------------------------------
Property[] properties = (Ar)article.ContentProperties.Deserialize();
IDictionary context = new Hashtable();
foreach(Property prop in properties)
{
context.Add(prop.Name, prop.Value);
}
prop.Name="Address";
${Address}
this.theList.Text = fileEngine.Process(context, templateName);
NVelocity
IContext context = ;
context.Add
DataItem item1 = new DataItem();
item1.Name = "地址"
item1.PropType = "Text";
DataItem item2 = new DataItem();
item2.Name = "介绍"
item2.PropType = "MultilineText";
item3.PropType = "RichText";
----------
<p></p>
----------
model1.AddItem(item1);
model1.AddItem(item2);
-----------------------------------------
Board board1 = new Board();
board1.DataModel = model1;
Article article = .. ;
article.Board = board1
DataModel dm = article.Board.DataModel;
foreach(DataItem item in dm.Items)
{
item.PropType
this.placeHolder.Controls.Add();
}
---------------------------------------
save:
ArrayList properties = new ArrayList();
foreach(DataItem item in dm.Items)
{
item.Name
this.placeHolder.Controls.FindControl(.);
Property prop = new Property();
prop.Name = item.Name;
prop.Value = ;
properties.Add(prop);
}
string ContentProperties = properties.Serialize();
---------------
ArrayList properties = new ArrayList();
--------------------------------------------------
Property[] properties = (Ar)article.ContentProperties.Deserialize();
IDictionary context = new Hashtable();
foreach(Property prop in properties)
{
context.Add(prop.Name, prop.Value);
}
prop.Name="Address";
${Address}
this.theList.Text = fileEngine.Process(context, templateName);
NVelocity
IContext context = ;
context.Add
Select * from news where Content like '%多%的%'