FineUI学习笔记2

第二章  简单登录页面

从第二章开始算是正式学习了,有点不解的地方就是教程是先用另一个dll, ExtAspNet。直接用FineUI不好么?
1、下载好以下东西先:
ExtAspNet:博主要求先用的控件。
Newtonsoft.Json.dll:需要添加的引用,不然会报错。
FineUI的资源文件,再添加引用FredCK.FCKeditorV2.dll,不然也会报错。
2、先进行web.config全局设置。
<configuration>
  <configSections>
    <section name="ExtAspNet" type="ExtAspNet.ConfigSection, ExtAspNet" requirePermission="false"/>
  </configSections>
  <ExtAspNet EnableBigFont="true" DebugMode="true" IconBasePath="~/Fineui/icon"/>
  <!--连接字符串-->
  <connectionStrings>
    <add name="localOraclStr" connectionString="Data Source=192.168.2.244/orcl;User ID=platform;pwd=pf123;Unicode=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  
  
    <system.web>
      <pages  controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
        <controls>
          <add assembly="ExtAspNet" namespace="ExtAspNet" tagPrefix="ext"/>
        </controls>
      </pages>
      
      
      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
    </system.web>
  <system.webServer>
    <modules>
      <add name="ExtAspNetScriptModule" type="ExtAspNet.ScriptModule, ExtAspNet"/>
      <!--<add type="wqcms.URLRewriter.ModzuleRewriter, wqcms_URLRewriter" name="ModuleRewriter" />-->
    </modules>
    <handlers>
      <add name="ExtAspNetResourceHandler" verb="GET" path="res.axd" type="ExtAspNet.ResourceHandler, ExtAspNet"/>
    </handlers>
  </system.webServer>
</configuration>




2、新控件ext:Window ,可以像一个模式窗口一样随便拉动,很炫。特殊属性WindowPosition="GoldenSection"
3、新控件ext:SimpleForm,简单表单,我想应该是。。。


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link href="Fineui/css/main.css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
    <ext:PageManager ID="PageManager1" runat="server" />
    <div>
    用户名:admin
    <br />
    密码:admin
    <br />
    <ext:Window ID="Window1" runat="server" Title="登录表单" IsModal="false" EnableClose="false"
    WindowPosition="GoldenSection" Width="350px">
        <Items>
            <ext:SimpleForm ID="SimpleForm1" runat="server" ShowBorder="false" BodyPadding="10px"
            LabelWidth="60px" EnableBackgroundColor="true" ShowHeader="false">
            <Items>
                <ext:TextBox ID="tbxUserName" Label="用户名" Required="true" runat="server">
                </ext:TextBox>
                <ext:TextBox ID="tbxPassword" Label="密码" TextMode="Password" Required="true" runat="server">
                </ext:TextBox>
                <ext:Button ID="btnLogin" Text="登录" Type="Submit" ValidateForms="SimpleForm1" ValidateTarget="Top"
                    runat="server" OnClick="btnLogin_Click">
                </ext:Button>
            </Items>
            </ext:SimpleForm>
        </Items>
    </ext:Window>
    </div>
    </form>
</body>
</html>

protected void btnLogin_Click(object sender, EventArgs e)
    {
        if (tbxUserName.Text == "admin" && tbxPassword.Text == "admin")
         {
             Alert.ShowInTop("成功登录!");
         }
         else
         {
             Alert.ShowInTop("用户名或密码错误!", MessageBoxIcon.Error);
        }
    }

3、心得
1)Alert的提示
2)window窗体控件,和他的属性 WindowPosition="GoldenSection"
3)控件 ext:SimpleForm,简单表单,和button配合用。
关键在:Type="Submit" ValidateForms="SimpleForm1"



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值