asp.net ʵÏÖexcelµ¼Èëµ½Êý¾Ý¿â
//ExcelÅúÁ¿µ¼Èëµ½Êý¾Ý¿â
protected void btnUpload_Click(object sender, EventArgs e)
{
string IsXls = System.IO.Path.GetExtension(UploadExcel.FileName.ToString().ToLower());
if (IsXls != ".xls")
{
Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script type='text/javascript' language='javascript'>alert('Ö»¿ÉÒÔÑ¡ÔñExcelÎļþ');location.href='EmployeeAddPage.aspx';</script>");
return;//µ±Ñ¡ÔñµÄ²»ÊÇExcelÎļþʱ,·µ»Ø
}
string filePath = UploadExcel.PostedFile.FileName;
string fileName = UploadExcel.FileName;
DataSet ds = ExecleDs (filePath,fileName);
CommonLayer.employeeModel model = new CommonLayer.employeeModel();
DataAcessLayer.employee_infomation addlist = new DataAcessLayer.employee_infomation();
if (ds.Tables[0].Rows.Count > 0)
{
int row = ds.Tables[0].Rows.Count-1;
for (int i = 0; i < ds.Tables[0].Select().Length; i++)
{
&
Ïà¹ØÎĵµ£º
ÔÚASP.NetÒ»°ãµÄ³ÌÐò±àдÖУ¬ËùʹÓõÄÊý¾ÝÀïÃæ£¬ÈÕÆÚʱ¼äÊÇÒ»ÖÖÌØÊâµÄÊý¾ÝÀàÐÍ£¬Ò²ÊǾ³£±»Ê¹Óõġ£---µçÄԽ̳̼¼ÊõÑ§Ï°Íø
ÔÚVisual Basic.NETÖеÄÈÕÆÚʱ¼äÊý¾ÝÓÃÊýÖµµÄÊý¾ÝÀàÐͱ£´æ£¬¶øÇÒÓз¶Î§¡£
ÈÕÆÚµÄ·¶Î§Êǹ«Ôª1Äê1ÔÂ1ÈÕ¡«¹«Ôª9999Äê1 2ÔÂ3 1ÈÕ£¬Ê±¼äµÄ·¶Î§ÊÇ00£º00£º00¡«23£º59£º59¡£ÉùÃ÷¸ñÊ½È ......
Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('¼ÓÈëÔÝ´æ¼Ü³É¹¦£¡');</script>");
asp.net¼òµ¥¼ÓÃÜ
//using System.Web.Security;
System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfig ......
·½·¨Ò»:javascript·¨ function btnClear() { for(i=0;i /// Çå¿ÕÖ¸¶¨Ò³ÃæÉÏËùÓеĿؼþÄÚÈÝ£¬°üÀ¨TextBox£¬CheckBox,CheckBoxList,RadioButton,RadioButtonList¡£µ«ÊDz»Çå /// ³ýÈçListBox£¬DropDownList£¬ÒòΪÕâÑùµÄ¿Ø¼þÖµ¶Ôµ±Ç°Ò³ÃæÀ´Ëµ»¹¿ÉÒÔÓã¬Ò»°ãÕâЩ¿Ø¼þÀï¶¼ÊDZ£´æµÄ×ÖµäÊý¾Ý¡£ /// Author£ºKevin /// ÈÕÆÚ£º2004-12 ......
Asp.netÖÐʵÏÖÒ³ÃæÌø×ªµÄÈýÖÖ·½·¨±È½Ï£¬ÏÖÔÚ×ܽáÈçÏ£º
1 Response.Redirect
Õâ¸öÌø×ªÒ³ÃæµÄ·½·¨Ìø×ªµÄËٶȲ»¿ì£¬ÒòΪËüÒª×ß2¸öÀ´»Ø£¨2´Îpostback£©£¬µ«Ëû¿ÉÒÔÌø תµ½ÈκÎÒ³Ãæ£¬Ã»ÓÐÕ¾µãÒ³ÃæÏÞÖÆ£¨¼´¿ÉÒÔÓÉÑÅ»¢Ìøµ½ÐÂÀË£©£¬Í¬Ê±²»ÄÜÌø¹ýµÇ¼±£»¤¡£µ«ËÙ¶ÈÂýÊÇÆä×î´óȱÏÝ£¡RedirectÌø×ª»úÖÆ£ºÊ×ÏÈÊÇ·¢ËÍÒ»¸öht ......
н¨Ò»¸öרÃÅÓÃÀ´´´½¨ÑéÖ¤ÂëͼƬµÄÒ³ÃæValidateCode.aspx
ËüµÄºǫ́csÎļþ´úÂëÈçÏ£º
PageLoad
private void Page_Load(object sender, System.EventArgs e)
{
string checkCode = CreateRandomCode(4);
Session["CheckCode"] = checkCode;
CreateImage(checkCode);
......