温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:多用户文件上传管理程序源码
当前文件:
FileSystem/usermanage.ascx,打开代码结构图
FileSystem/usermanage.ascx,打开代码结构图1<%@ Control Language="C#" AutoEventWireup="true" CodeFile="usermanage.ascx.cs" Inherits="usermanage" %> 2
<table style="width: 492px; height: 213px"> 3
<tr> 4
<th style="width: 200px"> 5
所有用户</th> 6
<th> 7
所有组<input name="rolename" id="rolename" type="hidden" /></th> 8
<th style="width: 133px"> 9
组成员</th> 10
</tr> 11
<tr> 12
<td style="text-align: center; width: 200px;" > 13
<asp:ListBox ID="ListBox1" runat="server" Height="152px" Width="115px" SelectionMode="Multiple"></asp:ListBox> 14
<asp:Button ID="Button4" runat="server" Text="删除选中用户" OnClientClick="return alertmsg('删除用户将一同删去该用户的所有文件,你确认?',false)" OnClick="Button4_Click" /> 15
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" OnClientClick="return getr() " Text="添加到选中组>>>" Width="118px" /></td> 16
<td style="text-align: center"> 17
<asp:ListBox ID="ListBox2" runat="server" Height="148px" Width="110px" AutoPostBack="True" OnSelectedIndexChanged="ListBox2_SelectedIndexChanged" SelectionMode="Multiple"></asp:ListBox> 18
<asp:Button ID="Button2" runat="server" OnClientClick="return alertmsg('组的添加或修改要配合修改WEB.CONFIG文件实现',true)" 19
Text="添加组" Width="56px" Visible="False" /> 20
<asp:Button ID="Button3" runat="server" OnClientClick="return delrole()" Text="删除组" Visible="False" /></td> 21
<td style="text-align: center; width: 133px;"> 22
<asp:ListBox ID="ListBox3" runat="server" Height="147px" Width="108px" SelectionMode="Multiple"></asp:ListBox> 23
<asp:Button ID="deluserbutton" runat="server" OnClick="deluserbutton_Click" Text="从该组删除" /></td> 24
</tr> 25
</table> 26
<asp:Label ID="Label1" runat="server" Height="19px" Width="454px"></asp:Label> 27
<script type="text/javascript"> 28
function alertmsg(msg,y){ 29
if(y){ 30
str = prompt("请输入你的新组名:",""); 31
if(str!=null && str!=""){ 32
document.getElementById("rolename").value=str; 33
return true; 34
} else return false; 35
}else return confirm(msg); 36
} 37
var listbox=document.getElementById("Usermanage1_ListBox2");//获取对象的选定值不合理 38
function getr(){ 39
sum=0; 40
msg=""; 41
for(i=0;i<listbox.length;i++) 42
if(listbox.options[i].selected) { 43
msg+=listbox.options[i].value+"、"; 44
sum++; 45
} 46
if(sum==0) { 47
alert("请先选择目标组"); 48
return false; 49
}else return alertmsg("你确认要用户添加到组:"+msg+"中吗?",false); 50
} 51
function delrole(){ 52
var f=0; 53
for(i=0;i<listbox.length;i++) 54
if(listbox.options[i].selected) f++; 55
if(f!=1) { 56
alert("请正确选择组后在删除"); 57
return false; 58
}else return alertmsg("你确认要删除这个组吗?",false); 59
} 60
</script> 61
62
63






str
}
}