<%@ Register TagPrefix="cc2" Namespace="dmenu" Assembly="dmenu" %>
<%@ Register TagPrefix="cc1" Namespace="dtable" Assembly="dtable" %>
<%@ Page CodeBehind="DTable_App.DTable_Test.l_008.aspx.cs" Language="c#" AutoEventWireup="false" Inherits=" DTable_App.DTable_Test.l_008" validateRequest="false" %>
<HTML>
	<HEAD>
		<TITLE>Dtable在列表显示时的应用—定义行首的显示</TITLE>
		<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
		<!-- ImageReady Preload Script (layout_SUB.psd) -->
		<SCRIPT TYPE="text/javascript">
<!--

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		Button_homepage_over = newImage("images/Button_homepage-over.gif");
		Button_AboutUs_over = newImage("images/Button_AboutUs-over.gif");
		Button_ContactUs_over = newImage("images/Button_ContactUs-over.gif");
		Button_HostingPlan_over = newImage("images/Button_HostingPlan-over.gif");
		Button_DedicatedServer_over = newImage("images/Button_DedicatedServer-over.gif");
		Button_Order_over = newImage("images/Button_Order-over.gif");
		preloadFlag = true;
	}
}


function testradio()
{
var bolFind = false ;
var sevalue="";	
var obj = document.getElementsByName("DTRadioSelect");
	for(i=0;i<obj.length;i++){
		if (obj[i].checked){
			sevalue =obj[i].value;
			bolFind = true ;
					}
	}
if(!bolFind)
{
window.alert('请选择一个项');
return false;
}
else
{
alert('您选择的ID是:' + sevalue);

}
}

function Dcheckclick(){
var obj = document.getElementsByName('DTCheckselect');
var strvalue='';
for(var i=0;i<obj.length;i++)
{if (obj[i].checked==true){
strvalue+=obj[i].value + ',';}}
if (strvalue.length>0)
{strvalue=strvalue.substr(0,strvalue.length-1);
alert('您选定了:' + strvalue);
}
else{
alert('请至少选择一条记录');
return true;
}
}


//-->
		</script>
		<!-- End Preload Script -->
		<link rel="stylesheet" type="text/css" href="style.css">
	</HEAD>
	<BODY BGCOLOR="#ffffff" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0"
		ONLOAD="preloadImages();">
		<!-- ImageReady Slices (layout_SUB.psd) -->
		<div align="center">
			<center>
				<table border="1" cellpadding="0" cellspacing="0" style="BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-COLLAPSE: collapse; BORDER-RIGHT-WIDTH: 0px"
					bordercolor="#111111" bgcolor="#000000">
					<tr>
						<td width="100%">
							<table WIDTH="760" BORDER="0" CELLPADDING="0" CELLSPACING="0" style="BORDER-COLLAPSE: collapse"
								bordercolor="#111111">
								<tr>
									<td COLSPAN="14">
										<img SRC="images/layout_01.gif"  height="56" width="565"></td>
									<td ROWSPAN="2">
										<img SRC="images/layout_sub_02.gif"  height="82" width="195"></td>
									<td><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="56"></td>
								</tr>
								<tr>
									<td><img SRC="images/layout_sub_03.gif"  height="26" width="15"></td>
									<td>
										<a ONMOUSEOVER="changeImages('Button_homepage', 'images/Button_homepage-over.gif'); return true;"
											ONMOUSEOUT="changeImages('Button_homepage', 'images/Button_homepage.gif'); return true;"
											href="index.aspx"><img NAME="Button_homepage" SRC="images/Button_homepage.gif" BORDER="0" ALT height="26"
												width="73"></a></td>
									<td><img SRC="images/layout_sub_05.gif"  height="26" width="7"></td>
									<td>
										<a ONMOUSEOVER="changeImages('Button_AboutUs', 'images/Button_AboutUs-over.gif'); return true;"
											ONMOUSEOUT="changeImages('Button_AboutUs', 'images/Button_AboutUs.gif'); return true;"
											href="userclub.aspx"><img NAME="Button_AboutUs" SRC="images/Button_AboutUs.gif" BORDER="0" ALT height="26"
												width="73"></a></td>
									<td><img SRC="images/layout_sub_07.gif"  height="26" width="7"></td>
									<td COLSPAN="3">
										<a ONMOUSEOVER="changeImages('Button_ContactUs', 'images/Button_ContactUs-over.gif'); return true;"
											ONMOUSEOUT="changeImages('Button_ContactUs', 'images/Button_ContactUs.gif'); return true;"
											href="download.aspx"><img NAME="Button_ContactUs" SRC="images/Button_ContactUs.gif" BORDER="0" ALT height="26"
												width="73"></a></td>
									<td><img SRC="images/layout_sub_09.gif"  height="26" width="12"></td>
									<td>
										<a ONMOUSEOVER="changeImages('Button_HostingPlan', 'images/Button_HostingPlan-over.gif'); return true;"
											ONMOUSEOUT="changeImages('Button_HostingPlan', 'images/Button_HostingPlan.gif'); return true;"
											href="example.aspx"><img NAME="Button_HostingPlan" SRC="images/Button_HostingPlan.gif" BORDER="0" ALT height="26"
												width="84"></a></td>
									<td><img SRC="images/layout_sub_11.gif"  height="26" width="6"></td>
									<td>
										<a ONMOUSEOVER="changeImages('Button_DedicatedServer', 'images/Button_DedicatedServer-over.gif'); return true;"
											ONMOUSEOUT="changeImages('Button_DedicatedServer', 'images/Button_DedicatedServer.gif'); return true;"
											href="article.aspx"><img NAME="Button_DedicatedServer" SRC="images/Button_DedicatedServer.gif" BORDER="0"
												ALT height="26" width="113"></a></td>
									<td><img SRC="images/layout_sub_13.gif"  height="26" width="7"></td>
									<td>
										<a href="../DTablebbs/" target="_blank" ONMOUSEOVER="changeImages('Button_Order', 'images/Button_Order-over.gif'); return true;"
											ONMOUSEOUT="changeImages('Button_Order', 'images/Button_Order.gif'); return true;">
											<img NAME="Button_Order" SRC="images/Button_Order.gif" BORDER="0" ALT height="26" width="95"></a></td>
									<td><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="26"></td>
								</tr>
								<tr>
									<td COLSPAN="7" ROWSPAN="6" valign="top" background="images/layout_sub_23.gif">
										<table border="0" cellpadding="0" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#111111"
											id="AutoNumber1" width="214">
											<tr>
												<td width="214" colspan="2">
													<img SRC="images/example.gif"  height="37" width="214"></td>
											</tr>
											<tr>
												<td width="204" valign="top">
													<table border="0" cellpadding="10" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#111111"
														width="100%" id="AutoNumber2">
														<tr>
															<td width="100%" valign="top"><FONT color="#ffffff" face="宋体">
																	<cc2:dmenu id="Dmenu1" runat="server"></cc2:dmenu></FONT></td>
														</tr>
													</table>
												</td>
												<td width="10">
													<img SRC="images/layout_sub_19.gif"  height="144" width="15"></td>
											</tr>
										</table>
									</td>
									<td COLSPAN="8">
										<img SRC="images/layout_sub_16.gif"  height="11" width="546"></td>
									<td><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="11"></td>
								</tr>
								<tr>
									<td COLSPAN="8" ROWSPAN="5" bgcolor="#ffffff" valign="top">
										<table border="0" cellpadding="8" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#111111"
											width="100%" id="AutoNumber1">
											<tr>
												<td width="98%"><a href="?type=radio">行首显示单选按钮</a> <a href="?type=checkbox">行首显示多选按钮</a>
													<a href="?type=number">行首显示序号</a> <a href="?type=html">行首显示固定标签</a> <a href="?type=condition">
														行首根据某列值比较结果确定显示</a>
													<cc1:dTable id="DTable1" runat="server"></cc1:dTable><BR>
													<asp:Label id="Label1" runat="server"></asp:Label></td>
												<td width="2%">&nbsp;</td>
											</tr>
											<tr>
												<td>
													<table width="100%" border="0">
														<tr>
															<td width="558" height="23" bgcolor="#abc7e2"><strong>本页属性设置</strong></td>
														</tr>
														<tr>
															<td height="327" bgcolor="#e7eef8"><P>
																	string strtype=sharecode.GetQueryStringValue("type"); //获取传入的类型
																	<br>
																	if(strtype!="") //如果有传入的参数就写入cookies
																	<br>
																	{<br>
																	Page.Response.Cookies["type"].Value=strtype;<br>
																	Page.Response.Cookies["type"].Expires =System.DateTime.Today.AddDays(100);<br>
																	<br>
																	}<br>
																	else if(sharecode.GetCookieValue("type")!="")//如果没有传入的参数就判断是否存在cookes,如果存在就获取<br>
																	{<br>
																	strtype=sharecode.GetCookieValue("type");<br>
																	}<br>
																</P>
																<p>
																	switch (strtype.ToLower())
																	<br>
																	{<br>
																	case "radio": //如果是radio就设置为单选
																	<br>
																	DTable1.List_NumCol="radio|||||||";<br>
																	Label1.Text =&quot;&lt;button onclick=\&quot;testradio();\&quot;&gt;测试单选按钮选定的值&lt;/button&gt;&quot;;																	<br>
																	break;</p>
																<p>
																	case "checkbox": //如果是checkbox就设置为复选
																	<br>
																	DTable1.List_NumCol="checkbox|||||||";<br>
																	Label1.Text =&quot;&lt;button onclick=\&quot;Dcheckclick();\&quot;&gt;测试复选框钮选定的值&lt;/button&gt;&quot;;																	<br>
																	break;<br>
																	<br>
																	case "number": //设置为序号
																	<br>
																	DTable1.List_NumCol="number|||||||";<br>
																	break;<br>
																	<br>
																	case "html": //设置为固定的标记<br>
																	DTable1.List_NumCol="html|&lt;font color=red&gt;$&lt;/font&gt;||||||";<br>
																	break;<br>
																	<br>
																	case "condition": //比较第5列的值,如果包含北京关键字,就显示"来自首都",否则就显示"其它城市"<br>
																	DTable1.List_NumCol="condition||5|北京@@string|like|来自首都|其它城市|";<br>
																	break;</p>
																<p>
																	<br>
																	}</p>
																<p>
																	DTable1.ConnStr=sharecode.DataconnectString; //设置数据库连接字符串
																	<br>
																	DTable1.TableName="雇员"; //设置表明
																	<br>
																	DTable1.List_SQL="select 雇员id,姓氏 + 名字 as 姓名,职务,尊称,出生日期,城市,分机 from 雇员 order 
																	by 雇员id desc"; //设置查询语句
</p>
																<p>页面的客户端函数:																</p>
																<P>function testradio()<br>
																  {<br>
																  var bolFind = false ;<br>
																  var sevalue=&quot;&quot;; <br>
																  var obj = document.getElementsByName(&quot;DTRadioSelect&quot;);<br>
for(i=0;i&lt;obj.length;i++){<br>
if (obj[i].checked){<br>
sevalue =obj[i].value;<br>
bolFind = true ;<br>
}<br>
}<br>
if(!bolFind)<br>
{<br>
window.alert('请选择一个项');<br>
return false;<br>
}<br>
else<br>
{<br>
alert('您选择的ID是:' + sevalue);</P>
															    <p>}<br>
															      }</p>
															    <p>function Dcheckclick(){<br>
															      var obj = document.getElementsByName('DTCheckselect');<br>
															      var strvalue='';<br>
															      for(var i=0;i&lt;obj.length;i++)<br>
															      {if (obj[i].checked==true){<br>
															      strvalue+=obj[i].value + ',';}}<br>
															      if (strvalue.length&gt;0)<br>
															      {strvalue=strvalue.substr(0,strvalue.length-1);<br>
															      alert('您选定了:' + strvalue);<br>
															      }<br>
															      else{<br>
															      alert('请至少选择一条记录');<br>
															      return true;<br>
															      }<br>
															      }</p>
															    <P><br>
															  </P></td>
														</tr>
													</table>
												</td>
												<td>&nbsp;</td>
											</tr>
										</table>
									</td>
									<td><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="26"></td>
								</tr>
								<tr>
									<td><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="144"></td>
								</tr>
								<tr>
									<td><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="39"></td>
								</tr>
								<tr>
									<td><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="213"></td>
								</tr>
								<tr>
									<td><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="13"></td>
								</tr>
								<tr>
									<td COLSPAN="15">
										<img SRC="images/layout_sub_24.gif"  height="8" width="760"></td>
									<td><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="8"></td>
								</tr>
								<tr>
									<td COLSPAN="15">
										<p align="center"><font color="#ffffff"><span lang="en-us"> <a href="help.htm"><font color="#ffffff">
															帮助中心</font></a>&nbsp; ::&nbsp; <a href="feiyong.htm"><font color="#ffffff">赞助费用</font></a>&nbsp; 
													::&nbsp; <a href="hkconfirm.htm"><font color="#ffffff">汇款确认</font></a>&nbsp; 
													::&nbsp; <a href="hkfs.htm"><font color="#ffffff">汇款方式</font></a>&nbsp; 
													::&nbsp; <a href="contact.htm"><font color="#ffffff">联系我们</font></a></span></font></p>
									</td>
									<td><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="26"></td>
								</tr>
								<tr>
									<td COLSPAN="15">
										<img SRC="images/layout_sub_26.gif"  height="21" width="760"></td>
									<td><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="21"></td>
								</tr>
								<tr>
									<td COLSPAN="15">
										<table border="0" cellpadding="8" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#111111"
											width="100%" id="AutoNumber2" bgcolor="#ffffff">
											<tr>
												<td width="100%">
													<p align="center"><span lang="en-us">COPYRIGHT (C) 2004, Dtable控件网 版权所有</span></p>
												</td>
											</tr>
										</table>
									</td>
									<td><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="17"></td>
								</tr>
								<tr>
									<td><img SRC="images/spacer.gif" WIDTH="15" HEIGHT="1" ></td>
									<td><img SRC="images/spacer.gif" WIDTH="73" HEIGHT="1" ></td>
									<td><img SRC="images/spacer.gif" WIDTH="7" HEIGHT="1" ></td>
									<td><img SRC="images/spacer.gif" WIDTH="73" HEIGHT="1" ></td>
									<td><img SRC="images/spacer.gif" WIDTH="7" HEIGHT="1" ></td>
									<td><img SRC="images/spacer.gif" WIDTH="24" HEIGHT="1" ></td>
									<td><img SRC="images/spacer.gif" WIDTH="15" HEIGHT="1" ></td>
									<td><img SRC="images/spacer.gif" WIDTH="34" HEIGHT="1" ></td>
									<td><img SRC="images/spacer.gif" WIDTH="12" HEIGHT="1" ></td>
									<td><img SRC="images/spacer.gif" WIDTH="84" HEIGHT="1" ></td>
									<td><img SRC="images/spacer.gif" WIDTH="6" HEIGHT="1" ></td>
									<td><img SRC="images/spacer.gif" WIDTH="113" HEIGHT="1" ></td>
									<td><img SRC="images/spacer.gif" WIDTH="7" HEIGHT="1" ></td>
									<td><img SRC="images/spacer.gif" WIDTH="95" HEIGHT="1" ></td>
									<td><img SRC="images/spacer.gif" WIDTH="195" HEIGHT="1" ></td>
									<td></td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</center>
		</div>
		<!-- End ImageReady Slices -->
	</BODY>
</HTML>
