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

PixelDragonsMVC.NET - An open source MVC framework

Rate me:
Please Sign up or sign in to vote.
4.58/5 (8 votes)
29 Jun 200710 min read 85K   73  
An MVC framework with built-in NHibernate support that makes creating ASP.NET 2 applications easier by minimizing code and configuration
<%@ Page Language="C#" MasterPageFile="~/UI/masterPages/public.master"%>

<asp:content id="content" contentplaceholderid="mainContent" runat="server">

    <script language="javascript">
        function onSaveClicked() {
            if(isValid()) {
                $("form").submit();
            }
        }
        
        function isValid() {
            var valid = true;
            
            if($F("name").length == 0) {
                valid = false;
                showErrorMessage("You must enter your name before you can continue.");
            } else if($F("userId").length == 0) {
                valid = false;
                showErrorMessage("You must enter a user id before you can continue.");
            } else if($F("password").length == 0) {
                valid = false;
                showErrorMessage("You must enter a password before you can continue.");
            }
            
            return valid;
        }
        
        function showErrorMessage(message) {
            $("errorMessage").innerHTML = message;
            $("errorBox").show();
        }
    </script>

    <h1>Create a new account</h1>
    <p>You can create a new account to store your contacts by completing the form below.</p>
    
    <div class="links"><a href="home.ashx">Cancel and go back to login</a></div>
    
    <div class="errorMessage" id="errorBox" style="display:none;"><img src="UI/images/icons/error.gif" align="absmiddle" /> <span id="errorMessage"></span></div>
    
    <form action="users-save.ashx" method="post" id="form">
        <div class="field">
            <div class="label"><label>Name:</label></div>
            <div class="control"><input type="text" name="name" id="name" /> (required)</div>
        </div>
        <div class="field">
            <div class="label"><label>User Id:</label></div>
            <div class="control"><input type="text" name="userId" id="userId" /> (required)</div>
        </div>
        <div class="field">
            <div class="label"><label>Password:</label></div>
            <div class="control"><input type="password" name="password" id="password" /> (required)</div>
        </div>
                
        <div class="field">
            <div class="label"></div>
            <div class="control"><img class="button" src="UI/images/buttons/save.gif" onclick="onSaveClicked();" /></div>
        </div>

    </form>
    
</asp:content>

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


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

Comments and Discussions