<%@ Register TagPrefix="cc2" Namespace="dmenu" Assembly="dmenu" %>
<%@ Register TagPrefix="cc1" Namespace="dtable" Assembly="dtable"  %>
<%@ Page CodeBehind="DTable_App.DTable_Test.ae002.aspx.cs" Language="c#" AutoEventWireup="false" Inherits=" DTable_App.DTable_Test.ae002" validateRequest="false" %>
<HTML>
	<HEAD>
		<TITLE>Dtable在记录添加/更新时的应用——2、 在新增、更新记录中使用上传文件、上传图片、内置图片以及缩略图的生成</TITLE>
		<script language="javascript">
function openimage(str)
{
  window.open('userfile/' + str,'_blank','');
}
		</script>
		<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;
	}
}

// -->
		</SCRIPT>
		<!-- End Preload Script -->
		<link rel="stylesheet" type="text/css" href="style.css">
			<style type="text/css">
.style1 { COLOR: #ff0000 }
</style>
	</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="791" height="947" BORDER="0" CELLPADDING="0" CELLSPACING="0" bordercolor="#111111"
								style="BORDER-COLLAPSE: collapse">
								<tr>
									<td height="56" COLSPAN="14">
										<img SRC="images/layout_01.gif"  height="56" width="565"></td>
									<td width="206" ROWSPAN="2">
										<img SRC="images/layout_sub_02.gif"  height="82" width="195"></td>
									<td width="1"><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="56"></td>
								</tr>
								<tr>
									<td width="15" height="26"><img SRC="images/layout_sub_03.gif"  height="26" width="15"></td>
									<td width="73">
										<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 width="7"><img SRC="images/layout_sub_05.gif"  height="26" width="7"></td>
									<td width="73">
										<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 width="7"><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 width="12"><img SRC="images/layout_sub_09.gif"  height="26" width="12"></td>
									<td width="84">
										<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 width="6"><img SRC="images/layout_sub_11.gif"  height="26" width="6"></td>
									<td width="113">
										<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 width="7"><img SRC="images/layout_sub_13.gif"  height="26" width="7"></td>
									<td width="114">
										<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 height="11" 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%"><span class="style1">为了得到更好的演示效果,近照和证书的图片不要太大,因为这两个字段保存的图像不是以缩略图的方式保存和显示.</span><cc1:dTable id="DTable1" runat="server"></cc1:dTable></td>
												<td width="2%">&nbsp;</td>
											</tr>
											<tr>
												<td>
													<table width="100%" border="0" cellpadding="9">
														<tr>
															<td height="23" bgcolor="#abc7e2"><strong>本页属性设置</strong></td>
														</tr>
														<tr>
															<td height="26" bgcolor="#e7eef8"><P>Table1.ConnStr=sharecode.DataconnectString; //数据库连接字符串</P>
																<P>DTable1.TableName ="图片字段测试"; //设置表名</P>
																<P>DTable1.List_SQL="select id,姓名,近照,证书,简介,身份证复印件 from 图片字段测试 order by id desc"; 
																	//设置查询语句</P>
																<P>DTable1.Edit_EnableEdt=true; //允许更新记录</P>
																<P>DTable1.Edit_EnableAdd =true; //允许新增记录</P>
																<P>DTable1.ShowBtn_All=true; //允许显示所有的内置按钮</P>
																<P>DTable1.Edit_FieldFormat="4||urlfile|userfile/|||请上传word文件来保存该用户的简历|";<br>
																	DTable1.Edit_FieldFormat+="^5||urlfile|userfile/||userfile/mini/|上传身份证件的扫描图片|";
																</P>
																<P>//新增/更新时字段的设置。其中定义了第4列是一个文件上传上传字段，上传的文件将保存到userfile/ . 
																	第5列同样是一个文件上传字段，但是定义了缩略图保存的路径为： userfile/mini 。当定义了缩略图保存的路径，dtable才会自动生成缩略图。 
																	同时，这两个字段还设置了描述语句，来说明这两个字段的相关信息。<BR>
																</P>
																<P>
																	DTable1.List_FieldFormat+= "^2||imagefield|近照|width=100|||";
																	<BR>
																	//设置列表显示的格式，第2列被定义为内置image图像字段,并定义了该字段的实际名称为"近照"，设置了图片的显示宽度为100</P>
																<P>DTable1.List_FieldFormat+="^3||imagefield|证书|width=100|||";<br>
																	//设置第3列也是image图像字段,并定义了字段的实际名称.设置了图片的显示宽度为100</P>
																<P>DTable1.List_FieldFormat="4||clickfield|openimage|4|||||";<br>
																	//为第4列设置点击事件 ,点击第4列的内容时,将要调用的客户端函数为"openimage", 并且传递一个参数给该函数,参数是第4列的值.<br>
																	客户端函数openimage:<br>
																	&lt;script language="javascript"&gt;<br>
																	function openimage(str)<br>
																	{<br>
																	window.open('userfile/' + str,'_blank','');<br>
																	}<br>
																	&lt;/script&gt;</P>
																<P>
																	<br>
																	DTable1.List_FieldFormat+="^5||urlimage|userfile/mini/|userfile/|_blank|width=100|||";<br>
																	//定义第5列为链接图像字段,图像显示的缩略图文件夹是"userfile/mini/", 
																	由于定义了大图片的地址"userfile/",所以将对第5列显示的缩略图生成一个超级链接,该链接将打开对应的大图片. 
																	由于定义了打开大图片的目标窗口是_blank,所以点击时将以打开新窗口的方式进行.设置了图片的显示宽度为100</P>
																<P>DTable1.Show_FieldFormat="4||urlimage|userfile/||||||^5||urlimage|userfile/||||||^2||imagefield|近照||||^3||imagefield|证书||||";
																	<br>
																	//这是定义在详细察看时的链接图片字段,设置方法同上.</P>
															</td>
														</tr>
													</table>
												</td>
												<td>&nbsp;</td>
											</tr>
										</table>
									</td>
									<td height="26"><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="26"></td>
								</tr>
								<tr>
									<td height="144"><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="144"></td>
								</tr>
								<tr>
									<td height="39"><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="39"></td>
								</tr>
								<tr>
									<td height="213"><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="213"></td>
								</tr>
								<tr>
									<td height="348"><img SRC="images/spacer.gif" WIDTH="1" HEIGHT="13"></td>
								</tr>
								<tr>
									<td height="8" 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 height="26" 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 height="21" 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 height="28" 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 height="1"><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 width="24"><img SRC="images/spacer.gif" WIDTH="24" HEIGHT="1" ></td>
									<td width="15"><img SRC="images/spacer.gif" WIDTH="15" HEIGHT="1" ></td>
									<td width="34"><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>
