完全没问题,我正在做我的第一个ASP.NET网站,并增加了使用IUI框架的功能,使得iPhone在外观上看起来不错。无法与聊天室服务器
- 如何连接whitebutton去验证数据库上的用户和密码?
- 我如何让布劳尔去一个不同的窗口,如果密码被别人好...
- 如何在当前页面上添加如“密码不正确”的消息?
我是一个默认的c#程序员,完全失去了这个新的领域。请不要让我无法做出它似乎不适用于IUI。
主
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="Cover_Plus.SiteMaster" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
<title></title>
<meta name="viewport" id="viewport" content="width=device-width, user-scalable=0, initial-scale=1.0" />
<link href="iui/iui.css" rel="stylesheet" type="text/css" />
<link title="default" href="iui/t/default/default-theme.css" rel="stylesheet" type="text/css" />
<script type="application/x-javascript" src="iui/iui.js"></script>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="img/touch-icon-iphone.png" />
<link rel="apple-touch-icon" sizes="72x72" href="img/touch-icon-ipad.png" />
<link rel="apple-touch-icon" sizes="114x114" href="img/touch-icon-iphone4.png" />
<link rel="apple-touch-startup-image" href="img/startup.png" />
<asp:ContentPlaceHolder ID="HeadContent" runat="server"> </asp:ContentPlaceHolder>
</head>
<body>
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
</body>
</html>
Default.aspx的
<%@ Page Title="Cover Plus" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Cover_Plus._Default" %>
<%--Header--%>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<script type="text/javascript">
</script>
</asp:Content>
<%--Body--%>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<div class="toolbar">
<h1 id="pageTitle">System Login</h1>
</div>
<div class="panel" selected="true" id="loginPanel">
<h2>Login to Cover Plus</h2>
<fieldset>
<div class="row">
<label>Name</label>
<input type="text" name="ident" text="hhh" placeholder="Your login" />
</div>
<div class="row">
<label>Password</label>
<input type="password" name="password" placeholder="Your password" />
</div>
</fieldset>
<form id="Form1" title="Index" name="formname" method="POST">
<a class="whiteButton" type="submit" href="javascript:formname.submit()">Login me in!</a>
</form>
</div>
</asp:Content>
UPDATE:
我觉得截图可能会有所帮助。
的问题是,“whitebutton”似乎是我有什么用,它不是像一个asp.net服务器端的按钮,所以我不能简单地双击来装click事件。
我尝试了Humpty Dumptys方法,但它并没有在我的.CS文件中调用Verify()方法。我试着用onclick =“Login();”代替Javascript:Login();都不工作。
更新2:
底部的作品,但只要我更换输入到文本框看看会发生什么......
很多感谢
最终解决方案:
<div class="toolbar">
<h1 id="pageTitle">Login</h1>
</div>
<div id="pnlLogin" class="panel" selected="true" >
<h2>Login Details</h2>
<form ID="fLogin" runat="server" class="panel" selected="true" >
<fieldset>
<div class="row">
<label>Name</label>
<asp:TextBox id="txtUserName" runat="server" placeholder="Your username" />
</div>
<div class="row">
<label>Password</label>
<asp:TextBox id="txtPassword" textmode="Password" runat="server" placeholder="Your password" />
</div>
</fieldset>
<asp:LinkButton id="btnLogin" class="whiteButton" text="Log me in!" runat="server" onclick="Login_Clicked" />
</form>
</div>
基本上,窗体是用“class = panel”装饰的,asp:style控件用于连接到后端。
你想验证对数据库中的用户? ?你是否使用asp.net会员提供商? – 2012-03-22 16:27:03
嗨,是的,我是,数据库是在服务器上,我可以处理所有的罚款,我只是不知道如何来回从客户端到服务器,并从服务器访问用户名和密码。 – sprocket12 2012-03-22 16:30:20
你读过http://www.asp.net/web-forms上的教程吗? – jrummell 2012-03-22 16:43:33