本文整理汇总了C#中System.Web.UI.WebControls.TableCell.CopyBaseAttributes方法的典型用法代码示例。如果您正苦于以下问题:C# TableCell.CopyBaseAttributes方法的具体用法?C# TableCell.CopyBaseAttributes怎么用?C# TableCell.CopyBaseAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.TableCell
的用法示例。
在下文中一共展示了TableCell.CopyBaseAttributes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
Avatar.Attributes.Add("title", "mxit:table:update");
Parts.Attributes.Add("title", "mxit:table:update");
string postData = Request.Params[null];
//Gaming gaming = new Gaming(parts, "Post.aspx");
JavaScriptSerializer jss = new JavaScriptSerializer();
TableReply reply = jss.Deserialize<TableReply>(postData);
//parts.Visible = true;
//parts.Attributes.Add("title", "mxit:table:update");
if (reply.Selected.Count > 0)
{
CellCoord c = reply.Selected[0];
Table prevParts = (Table)Session["partstable"];
Table prevAvatar = (Table)Session["avatartable"];
String id = prevParts.Rows[c.Row].Cells[c.Col].Attributes["data-mxit-init"];
String prevav = prevAvatar.Rows[0].Cells[0].Attributes["data-mxit-init"];
id = id.Substring(id.IndexOf("['")+2);
id = id.Substring(0,id.IndexOf("']"));
id = "B" + id;
String tempid = id.Substring(0, id.IndexOf(".")+1);
TableCell cell = prevAvatar.Rows[0].Cells[0];
Gaming avatar = new Gaming(Avatar, "Post.aspx");
avatar.AddRow();
using (TableCell newTC = new TableCell())
{
newTC.CopyBaseAttributes(cell);
newTC.ID = cell.ID;
newTC.Text = cell.Text;
foreach (string key in cell.Attributes.Keys)
{
newTC.Attributes.Add(key, cell.Attributes[key]);
}
foreach (string k in cell.Style.Keys)
{
newTC.Style.Add(k, cell.Style[k]);
}
avatar.CurrentRow.Cells.Add(newTC);
}
if (prevav.Contains(",'" + id + "'"))
{
Avatar.Rows[0].Cells[0].Attributes["data-mxit-init"] = prevav.Replace(",'" + id + "'", "");
}
else if (prevav.Contains(",'" + tempid ))
{
prevav = prevav.Remove(prevav.IndexOf(",'" + tempid),(",'" + tempid).Length+2); //remove old item and replace with new one
Avatar.Rows[0].Cells[0].Attributes["data-mxit-init"] = prevav.Insert(prevav.IndexOf(']'), ",'" + id + "'");
}
else
{
Avatar.Rows[0].Cells[0].Attributes["data-mxit-init"] = prevav.Insert(prevav.IndexOf(']'), ",'" + id + "'");
}
Session["avatartable"] = Avatar;
}
}