Click here to Skip to main content
15,895,746 members
Articles / Web Development / HTML

A Simple Tutorial on Developing ASP.NET Applications in MVC Pattern

Rate me:
Please Sign up or sign in to vote.
4.82/5 (45 votes)
13 May 2010CPOL17 min read 407K   18.1K   142  
This article gives a simple tutorial on developing ASP.NET applications in MVC pattern.
<%@ Page Language="C#"
    MasterPageFile="~/Views/Shared/Site.Master"
    CodeBehind="~/Views/Students/AddStudent.aspx.cs"
    Inherits="ASPNetMVCTutorial.Views.Students.AddStudent" %>

<asp:Content ID="AddStudentContent" 
    ContentPlaceHolderID="ApplicationContent" runat="server">
<script language="javascript" type="text/javascript">
    function SubmitForm() {
        frmAddStudent.action = hidAddstudentActionURL.value;
        frmAddStudent.submit();
    }
</script>

<asp:Literal ID="litAddStudentActionHidden" runat="server" />
<form id="frmAddStudent" method="post" action="">
<div style="text-align: center">
    <table cellspacing="5px" cellpadding="0px" style="text-align: 
        center; margin-left:auto; margin-right:auto;">
        <tr>
            <td class="BoldText" style="text-align: left">
                Please provide the following information to add the student:
            </td>
        </tr>
        <tr><td style="height: 10px"></td></tr>
        <tr>
            <td>
                Name&nbsp;<input type="text" id="textName" name="textName" />
                &nbsp;&nbsp;
                Score&nbsp;<input type="text" id="txtScore" name="txtScore" />
            </td>
        </tr>
        
        <tr>
            <td>
                <asp:HyperLink ID="linkCancelAddStudent" 
                    Text="Cancel add student and return to the main page" runat="server" />
                <input type="button" value="Add student" onclick="return SubmitForm()" />
            </td>
        </tr>
    </table>
</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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
I have been working in the IT industry for some time. It is still exciting and I am still learning. I am a happy and honest person, and I want to be your friend.

Comments and Discussions