Asp.Net中gridview中嵌入的checkbox使用
<asp:checkbox id = "checkbox1" runat = "server" AutoPostBack = "true" OnCheckedChanged = "CheckAllBox_Checked" text = "全选">
<asp:CheckBox ID = "CheckBox1" AutoPostBack = "true" OnCheckedChanged = "CheckBox1_Checked" runat = "server"/>
protected void CheckBox1_Checked(object sender, EventArgs e)
{
CheckBox cb = (CheckBox)sender;
int index = ((GridViewRow)(cb.NamingContainer)).RowIndex;
if (cb.Checked)
{
gridView.Rows[index].BackColor = Color.BurlyWood;
}
else
{
gridView.Rows[index].BackColor = gridView.RowStyle.BackColor;
}
}
protected void CheckAllBox_Checked(object sender, EventArgs e)
{
if (CheckAll.Checked)
{
for (int i = 0; i < gridView.Rows.Count; i++)
{
CheckBox cb = (CheckBox)gridView.Rows[i].FindControl("CheckBox1");
if (!cb.Checked)
{
cb.Checked = true;
&nbs
相关文档:
这篇教程的目的是让你体会一下创建一个 ASP.NET MVC 程序是一种什么样的感觉。在这篇教程里,我通过从头到尾地创建一整个ASP.NET MVC程序来进行说明。我会教你如何创建一个简单的数据库驱动程序,此程序会演示你如何以列表显示、新建和编辑数据库记录。
为了简化我们创建程序的过程 ......
如果仅仅是上传一个文件,最好是使用FileUpload控件, 可以使用FileUpload1.FileContent.Length得到文件大小, FileUpload1.FileBytes得到其字节数组, 代码略.
如果要上传多个文件, 其客户端代码与使用ASP.NET上传多个文件到服务器基本相同, 本例中加入了下载的示例代码。
效果图如下:
数据库脚本
create data ......
在Email系统中经常会上传多个文件到服务器,用户大多习惯一次上传所有的文件,而不是逐个上传,我们可以使用javascript动态地添加file元素到表单,然后在服务器端处理这些file
效果图如下:
页面代码MutlileFileUpload.aspx如下:
view plaincopy to clipboardprint?
<%@ Page Language="C#" AutoEventWireup="true" C ......
原地址:
http://msdn.microsoft.com/en-us/library/aa480476.aspx
IIS Authentication
ASP.NET authentication is a two-step process. First, Internet Information Services (IIS) authenticates the user and creates a Windows token to represent the user. IIS determines the authentication mode that it shoul ......