Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8463951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:35:34+00:00 2026-06-10T14:35:34+00:00

Microsoft web application architecture related… Wondering if I’m making a mistake by not using

  • 0

Microsoft web application architecture related…

Wondering if I’m making a mistake by not using .Net’s MVC for my new web application? I started out web development in ASP Classic and have moved forward with each iteration of ASP.net. I’ve monkeyed around with ASP.net MVC the past few months and just didn’t like certain parts of it. I like routing, razor, and the idea of view specific models. But it just seemed like my apps were getting overly complex after adding a few functionalities–I feel the same is true when I look at the MVC versions of apps like nopCommerce and Umbraco compared to their prior versions.

I went back and basically started writing a .Net Website/MVC hybrid. I created my own base class for “view models” that implemented Data Annotation validation; a Simple Mapper to bind form submissions to the models and to map entity properties to model properties and vice versa; created extension methods and helpers for things like paging, checked, selected, and even/odd; use controls like Repeaters, Literals, and standard HTML tags with runat="server" that don’t require view state.

This approach seems to allow me to have the best of both worlds, keeps my “Controller” code close to the “View”, and everything works in Medium Trust.

Here is some sample code:

public partial class Admin_Users_RoleAdd : System.Web.UI.Page
{
    protected class RoleAddModel : BaseModel
    {
        [Required, StringLength(100)]
        public string Name { get; set; }
        [StringLength(250)]
        public string Description { get; set; }

        public override bool Validate()
        {
            if (base.Validate() && Cortex.DB.Roles.Any(r => r.Name == Name))
                Errors["Name"] = "Already in use";
            return Errors.Count == 0;
        }
    }
    protected RoleAddModel model = new RoleAddModel();
    protected override void OnInit(EventArgs e)
    {
        if (Request.Form["Submit"].HasValue())
        {
            SimpleMapper.FormMap<RoleAddModel>(model);
            if (model.Validate())
            {
                var entity = new Role();
                SimpleMapper.Map<RoleAddModel, Role>(model, entity);
                Cortex.DB.Roles.AddObject(entity);
                Cortex.DB.SaveChanges();
                Response.Redirect("Roles.aspx");
            }
        }
        base.OnInit(e);
    }
}

And the “View”:

<h1>Add Role</h1>

    <div id="MainForm" class="form">
        <%= model.GetErrorMessage("Error") %>
        <form action="<%= Request.RawUrl %>" method="post">
            <div class="formField">
                <label for="Name">Name</label> <%= model.GetErrorMessage("Name") %><br />
                <input type="text" name="Name" value="<%: model.Name %>" class="required" maxlength="100" />                
            </div>
            <div class="formField">
                <label for="Description">Description</label> <%= model.GetErrorMessage("Description") %><br />
                <textarea rows="8" cols="40" name="Description" maxlength="250"><%: model.Description %></textarea>             
            </div>
            <div class="buttons">
                <input type="submit" name="Submit" value="Create" class="primary" />
                <a href="Roles.aspx">Back</a>
            </div>
        </form>
    </div>

Are there things I will regret about this approach later? The main thing I can think of at the moment is test-ability, but the VWD Express doesn’t support it anyway.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:35:36+00:00Added an answer on June 10, 2026 at 2:35 pm

    I don’t like Microsoft’s implementation on MVC; the use of magic strings, that it seems somewhat backward to say the action then the controller, that it’s like having to learn a dozen new language because it’s full of microsolutions (routing, razor).

    I dislike it so much so I started to write my own, but the more I wrote, the more I realized it was inflexible and the more I fixed this, the more like the Microsoft implementation it looked.

    After hours and hours and hours of development on essentially a crap version of MVC, I ditched it. I’ve started to go back over design documents and code and write over (or at) the top of them

    WRITE LESS CODE

    I rewrote the UI tier of my crappy MVC app to the MS MVC in about eight hours. I’d been working on it for about eight weeks before that. Granted most of the thinking had already been done so it may not have been that quick to write an MVC from scratch.

    Almost everything I used was out of the box, except the AuthorizeAttribute class, which just didn’t do what I wanted it to do.

    Why this relevant to your question?

    It’s a mistake to write code when you don’t need to. If you have tried and tested libraries, reuse them, if you don’t then look for them from a trusted source before writing your own. None of my problems are new and I doubt none if any of yours are too. They’ve all been solved by people who have more resources at their disposal than most of us.

    Part of this realization that I should stop reinventing wheels and just code what doesn’t come prepackaged is I’m working on a migration project at work, with Lawyers discussing the finer points of IP relating to some encryption routines. We’re going to need to spend weeks writing some code to translate data to another format because we can’t ‘give away’ our IP that was used to secure the data. If the app was just written with canned libraries, it would just be the data and the encryption keys we’d need to hand over. It would be done by now rather than a tenth draft for the lawyers to discuss.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing one web application using asp.net 2005 and Microsoft SQL Server 2008
I have a requirement to pass credentials from one Microsoft .NET Web Application to
First Some Background I'm planning out the architecture for a new PHP web application
I am using the IIS Powershell snapin to configure a new web application from
I'm developing a small web application using Microsoft Silverlight 3. I'm using Microsoft Expressin
In my web application, I am using Microsoft.Office.Interop.Excel to generate a pivot table in
I am Developing a web application by using ASP.NET 3.5, jQuery and RadAjax Telerik
i am using Microsoft web browser control in an MFC Application. It displays a
I'm rewriting an application so that we can stop using the old Microsoft.Web.Services2.Security.X509 from
I'm receiving suddenly this error on a Win2003 Server Web Application: Microsoft VBScript runtime

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.