62,050
社区成员
发帖
与我相关
我的任务
分享
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Main_Login" Theme="Default"%>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Main_Login" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=ConfigurationManager.AppSettings["Title"]%></title>
<style type="text/css">
#loginbody {
background-color: #EFF1FC;
background-image: url(images/login_01.gif);
background-repeat: repeat-x;
background-position: top;
}
#logindiv {
width: 744px;
margin-top: 88px;
margin-right: auto;
margin-left: auto;
background-color: #FFFFFF;
border: 1px solid #C8CEDA;
}
#loginimg {
background-image: url(images/login_04.gif);
background-repeat: no-repeat;
height: 380px;
width: 720px;
margin-top: 12px;
margin-right: auto;
margin-left: auto;
}
#loginform {
margin-top: 30px;
margin-right: auto;
margin-bottom: 30px;
margin-left: auto;
font-size: 14px;
width: 614px;
}
.loginformip{
font-size: 14px;
line-height: 24px;
border: 1px solid #999999;
height: 24px;
margin-right: 20px;
padding-left: 4px;
}
.loginformbutton{
height: 28px;
width: 60px;
font-size: 14px;
}
#loginc {
clear: both;
margin-right: auto;
margin-left: auto;
background-image: url(images/login_08.gif);
background-repeat: no-repeat;
height: 38px;
width: 603px;
margin-top: 20px;
}
</style>
</head>
<body id="loginbody">
<form id="form1" defaultfocus="" runat="server">
<div id="logindiv">
<div id="loginimg"></div>
<div id="loginform">
登录ID:
<asp:TextBox ID="txtLoginName" runat="server" class="loginformip"></asp:TextBox>
密码:
<asp:TextBox ID="txtLoginPassword" runat="server" TextMode="Password" class="loginformip"></asp:TextBox>
<asp:Button ID="btnLogin" runat="server" Text="登录" class="loginformbutton" onclick="btnLogin_Click" OnClientClick="javascript:return login()"/>
</div>
</div>
<div id="loginc"></div>
</form>
</body>
</html>
<script language="javascript" type="text/javascript">
function login() {
var name = document.getElementById("txtLoginName").value;
var password = document.getElementById("txtLoginPassword").value;
if (name == "" || name == null) {
alert("请输入登录ID!");
return false;
}
else
if (password == "" || password == null) {
alert("请输入密码!");
return false;
}
}
</script>
这样的话 再IE和火狐下都是没有问题的!
请高手帮忙解决下 。谢谢
分有点少,请见谅。