Click here to Skip to main content
15,891,423 members
Articles / Web Development / ASP.NET

Using Silverlight in Enterprise: RAD of User Friendly Database Access

Rate me:
Please Sign up or sign in to vote.
4.81/5 (19 votes)
31 Jul 2009CPOL8 min read 58.2K   7K   80  
This article introduces FulcrumWeb RAD Framework - A Silverlight UI Engine to build user friendly database driven applications
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="App.Silverlight.Server.Login1" %>

<%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls"
    TagPrefix="asp" %>
<!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 id="head" runat="server">
    <title></title>
    <link href="~/styles/main.css" rel="stylesheet" type="text/css" />
</head>
<body onload="onLoad()">
    <div class="top_padding">
    </div>
    <div class="logo">
        <img alt="fulcrum logo" src="images/logo_fulcrum.gif" width="216" height="74" />
        <div class="issuetracker" id="appTitle" runat="server">
           FulcrumWeb Issue Tracker Demo
        </div>
    </div>

    <script type="text/javascript">
        function ShowSilverlightNotInstalledScreen() {
            var loginContent = document.getElementById("loginContent");
            loginContent.innerHTML =
                "<div class=\"silverlight\"></div>" +
                "<div class=\"silverlight_link\">" +
                "This application requires Silverlight 2.0<br />" +
                "to be installed on your computer.<br />" +
                "Please visit <a href=\"http://www.microsoft.com/Silverlight/Install.aspx\">www.microsoft.com/Silverlight/Install.aspx</a>" +
                "</div>";

        }

        function isSilverlightInstalled() {
            var isSilverlightInstalled = false;
            try {
                //check on IE
                try {
                    var slControl = new ActiveXObject('AgControl.AgControl');
                    isSilverlightInstalled = true;
                }
                catch (e) {
                    //either not installed or not IE. Check Firefox
                    if (navigator.plugins["Silverlight Plug-In"]) {
                        isSilverlightInstalled = true;
                    }
                }
            }
            catch (e) {
                //we don't want to leak exceptions. However, you may want
                //to add exception tracking code here.
            }
            return isSilverlightInstalled;
        }
        function onLoad() {
            if (isSilverlightInstalled() == false) {
                ShowSilverlightNotInstalledScreen();
            }
        }
    </script>    

    <div class="login_area">
        <form id="form1" runat="server">
        
<%--         <div class="label">
                Username</div>
            <div class="field">
                <input name="login" type="text" /></div>
            <div class="demo_button_area">
                <input class="demo_bt" name="login" type="submit" value="&nbsp;" />
            </div>--%>
        
        <div style="position: absolute; left: 0px; top: 0px;">
            <asp:Silverlight ID="TestSilverlightInstalledPlugin" runat="server" Height="1px"
                Width="1px">
                <PluginNotInstalledTemplate>
                </PluginNotInstalledTemplate>
            </asp:Silverlight>
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
        </div>
        
        <div id="loginContent">
            <div class="label">
                Username
            </div>
            <table border="0" style="margin-left: 30px">
                <tr>
                    <td>
                        <div class="field">
                            <input id="UserName" runat="server" name="login" type="text" maxlength="50" />
                        </div>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="UserNameRequiredValidator" runat="server" ErrorMessage="*"
                            ControlToValidate="UserName" Style="line-height: 19px; font-size: 24px" />
                    </td>
                </tr>
            </table>
        <%--    <div class="error_label" >
                <asp:RegularExpressionValidator ID="UserNameValidator" runat="server" ControlToValidate="UserName"
                    ErrorMessage="Incorrect Username" ValidationExpression="[\w| ]*" />
            </div>--%>
          <%--  <div class="label">
                Password
            </div>
            <table border="0" style="margin-left: 30px">
                <tr>
                    <td>
                        <div class="field">
                            <input id="Password" runat="server" name="password" type="password" 
                                maxlength="150" />
                        </div>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="PwdRequiredValidator" runat="server" ErrorMessage="*"
                            ControlToValidate="Password" Style="line-height: 19px; font-size: 24px" />
                    </td>
                </tr>
            </table>--%>
            <div class="error_label" >
                <span id="lblBadLogin" runat="server" visible="false">Your login attempt was not successful.
                    Please try again.</span>
            </div>
          <%--     <div class="remember">
                <input id="rememberme" type="checkbox" value="rememberme" runat="server" />
                <label for="rememberme">
                    Remember me
                </label>
            </div>--%>
            <div class="demo_button_area" style="margin:50px 0px 0px 100px;">
                <asp:Button CssClass="demo_bt" runat="server" ID="btnLogin" name="login" OnClick="btnLogin_Click" />
            </div>
        </div>
        </form>
    </div>
    <div class="blue_splash">
    </div>
    <div class="copy">
        Powered by <a target="_blank" href="http://www.fulcrumweb.com">FulcrumWeb</a> RAD framework
    </div>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Ukraine Ukraine
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions