完全沒問題,我正在做我的第一個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