对GridView的行加颜色并弹出Kindeditor的实现思路

复制代码 代码如下:


<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript">
function tureDelete() {
if (confirm('真的要删除吗?') == false)
{ return false;}
}
function showdiv()
{
document.getElementByIdx_x("show1").style.display = "block";
document.getElementByIdx_x("showDiv").style.display = "block";
}
</script>
<link href="https://www.jb51.net/Kindeditor/themes/default/default.css" />
<link href="https://www.jb51.net/Kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="https://www.jb51.net/Kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="https://www.jb51.net/Kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="https://www.jb51.net/Kindeditor/plugins/code/prettify.js"></script>
<script>
KindEditor.ready(function (K) {
var editor1 = K.create('#content1', {
cssPath: 'https://www.jb51.net/Kindeditor/plugins/code/prettify.css',
uploadJson: 'Kindeditor/asp.net/upload_json.ashx',
fileManagerJson: 'Kindeditor/asp.net/file_manager_json.ashx',
allowFileManager: true,
afterCreate: function () {
var self = this;
K.ctrl(document, 13, function () {
self.sync();
K('form[name=example]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function () {
self.sync();
K('form[name=example]')[0].submit();
});
}
});
prettyPrint();
});
</script>
<style type="text/css">
#showDiv {
position:absolute;
top:50%;
left:50%;
margin-left:-350px;
margin-top:-250px;
}
</style>
</head>
<body>
<asp:Label runat="server" Visible="false" Text=""></asp:Label>
<form runat="server">
<div></div>
<div>
<table>
<tr>
<td>
标题
</td>
<td>
<asp:TextBox runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
内容
</td>
<td>
<textarea cols="100" rows="8" runat="server"></textarea>
</td>
</tr>
<tr>
<td>
类别
</td>
<td>
<asp:DropDownList runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
用户
</td>
<td>
<asp:DropDownList runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Button runat="server" Text="保存" />
</td>
</tr>
</table>
</div>
<div >
<table>
<tr>
<td>
<asp:GridView runat="server" AllowSorting="True" OnSorting="GridView1_Sorting" OnRowDataBound="GridView1_RowDataBound" ShowFooter="True">
<Columns>
<asp:TemplateField HeaderText="选择">
<ItemTemplate>
<asp:CheckBox runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="标题">
<ItemTemplate>
<a href='WebForm1.aspx?id=<%#eval_r("Id") %>'><%#eval_r("NewsTitle") %></a>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="NewsContent" HeaderText="内容" />
<asp:BoundField DataField="RealName" HeaderText="创建者" SortExpression="RealName" />
<asp:BoundField DataField="CreateTime" DataFormatString="{0:yyyy-mm-dd hh:mm:ss}" HeaderText="创建时间" SortExpression="CreateTime" />
<asp:BoundField DataField="ClassName" HeaderText="类型" />
<asp:TemplateField HeaderText="操作">
<ItemTemplate>
<asp:LinkButton CommandArgument='<%# eval_r("Id") %>' runat="server">编辑</asp:LinkButton>
<asp:LinkButton CommandArgument='<%# eval_r("Id") %>' runat="server">删除</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
<tr>
<td>
<asp:LinkButton runat="server">第一页</asp:LinkButton>
<asp:LinkButton runat="server">上一页</asp:LinkButton>
<asp:LinkButton runat="server">下一页</asp:LinkButton>
<asp:LinkButton runat="server">最后一页</asp:LinkButton>
&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button runat="server" Text="删除" OnClientClick="return tureDelete()" />
<asp:Button runat="server" Text="弹出层" />
</td>
</tr>
</table>
</div>
</form>
</body>


后台代码:

复制代码 代码如下:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjgpwj.html