.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to remove the Controller postfix dependency in naming controllers?

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :ASP.Net
In the  Controllers directory, naming every controller with "Controller" prefix seems plain stupid. Is there a way to remove this dependency?

View Complete Post

More Related Resource Links

Oracle Migration assitance to remove SYSDB dependency


Recently for a customer we migrated Oracle database to SQL Server 2008 using SSMA tool (SQL Server Migration Assistance for Oracle).The SSMA tool also creates a SYSDB database on the SQL Server instance which contains the replica of Oracle system function that do not exists in SQL Server.


Now the scenario is following statements cannot be executed inside the user defined function of SQL Server:

1) Raising errors or exceptions handling

2) Print statements

3) DML operations  like UPDATE, INSERT, DELETE that modify tables, except for local table variables

4) A call of a stored procedure


Model View Controller (MVC) for ASP.NET

Model View Controller (MVC) architectures, immediately wonder how the MVC pattern can be applied in an ASP.NET world. This article will demonstrate how the MVC pattern can be applied to an ASP.NET web application and still maintain the basic Microsoft supplied architecture.

Dependency Properties

When you begin to develop appliations with WPF, you will soon stumble across DependencyProperties. They look quite similar to normal .NET properties, but the concept behind is much more complex and powerful

partial view, 2 controllers



This is my first visit to the forums, I hope someone here can help me


I'm writing a small webapplication for creating repair tickets and adding comments, really basic

now I'm writing this in MVC2

So I have 2 controllers, 1 HomeController that does everything related to the tickets (listing tickets, creating new ones, editing) and 1 controller for the comments

the edit view for the homecontroller contains a partial view for /comment/create

so /home/edit/ticketnumber can edit the title and status of the ticket on the left side of the screen, the right side of the screen contains the partial view for adding comments

this is done like this:

Html.Renderaction("Create", "Comment");

but if I look at the generated html code when running the app, both save buttons go to /home/edit/ticketnumber

so the comment is never saved.


I hope this makes sense and that someone can help me solve this

Remove #Region from whole web site


Hi All,

I need to deliver source code to client and my boss need to remove all the comments and #region sections from the whole web site source code.

So is there any functionality available in visual studio 2010 or may be in an other 3rd party tool available to do so, which can remove all the #region from all over the source code ?

Otherwise my developers has to do donkey work.... :(( and I don't wish it. 

Any help or tips/tricks would be appreciated.


Web deployment project - web.config section replacement does not add remove tag


I have a web application that is actually installed as a component of a third party site.  In some configurations, I need to remove certain connection strings and re-add them.  I'm replacing this web.config section with a xml file that includes the following:

      <remove name="MyOverridenConnection"/>
      <add connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDb;Data Source=MyServer" name="MyOverridenConnection"

For some reason the remove tag is left out during the substitution and I end up with the following in the installed config:

      <add connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDb;Data Source=MyServer" name="MyOverridenConnection"

Is there any way to issue removes in replaced sec

Remove characters in a string


i have a string like this   sravani/, asdfff/, lsdsf/
i want to remove last character '/'  in the above string...
which function can i use?

pls help me....

Inside Microsoft patterns & practices: Dependency Injection in Libraries


This article discusses how to write a library or framework that uses the Dependency Injection pattern and how the change in focus affects the usage of the pattern.

Chris Tavares

MSDN Magazine November 2009

Extreme ASP.NET: The Life And Times of an ASP.NET MVC Controller


Here the author dissects the ASP.NET MVC framework and looks at how controllers work. He then explains how the framework interacts with your controllers and how you can influence those interactions.

Scott Allen

MSDN Magazine May 2009

Foundations: Dependency Properties And Notifications


Windows Presentation Foundation dependency properties don't always play well with others. Learn how you can compensate for their lack of notification events.

Charles Petzold

MSDN Magazine September 2008

{ End Bracket }: Dependency Management


Dependency management, in which one group provides a software component to be utilized by others, can really benefit from some structure and collaborative efforts.

Eric N. Bush

MSDN Magazine August 2007

Design Patterns: Dependency Injection


Today there is a greater focus than ever on reusing existing components and wiring together disparate components to form a cohesive architecture. But this wiring can quickly become a daunting task because as application size and complexity increase, so do dependencies.

Griffin Caprio

MSDN Magazine September 2005

Basic Instincts: Naming and Building Assemblies in Visual Basic .NET


Learn what the different parts of an assembly name mean, how to create a stronly named assembly, and get other assembly security tips.

Ted Pattison

MSDN Magazine August 2003

file not passing to controller


 I am getting an null referance on file, what am I doing wrong. 

<% Html.EnableClientValidation(); %>
<% Html.BeginForm("AddMedia", "Pattern", new { id= Model.Pattern_Guid} , FormMethod.Post, new {enctype = "multipart/form-data"}); %>
<%: Html.ValidationSummary(true) %>
    <%: Html.Label("height") %>
    <%: Html.TextBox("height") %>

    <%: Html.Label("width") %>
    <%: Html.TextBox("width") %>

    <%: Html.Label("Media") %>
    <input type="file" id="Media" name="Media" />
    <input type="submit" name="btnAdd" value="Add" />
<% Html.EndForm(); %>

controller code:

        public ActionResult AddMedia(Guid id, HttpPostedFileBase file, FormCollection collection)
            string mimeType = file.ContentType; //  Null Exception here ..

Controllers AccountController IFormsAuthentication MVC 2 error vs2010


I finally got around to trying vs2010 and MVC 2 ... I'm glad I did not put them on a production computer.

My first compile (I have not had a chance to investigate because I just did this and I am too tired).

All I did was create a MVC 2 solution with MSTEST Unit Testing selected too.

I compiled it and get four unexpected errors (because I have heard ASP.NET MVC 2 "alpha" and vs2010 Beta 2 are supposed to be somewhat robust):

In both HomeController and AccountController:

"The type or namespace name "Controllers" does not exist ins the namespace "mvczzzzz001" occurs twice, once for HomeController.cs and once for AccountController.cs.

AccountControllerTest.cs has two errors:  can not find "AccountController" namespace and can not find "IFormsAuthentication" namespace.

With ASP.NET MVC v1.0 there are errors when one uses xUnit.net (version at time of ASP.NET MVC v1.0 RTM) as the test framework but not errors with MSTEST (I prefer xUnit.net to MSTEST).

I am just so surprised to find such errors in vs2010 + MVC 2 ....

is this happening to anyone else?????????????????

Thank you ~~ regards, Gerry (Lowry)

How To Remove a Query Parameter from a URL


for a string such as this:


how would I remove the parameter id 12?


Remove HTML formatting


Anyone know how to remove html-formatted-string to plain text programatically?

I want to get the same result as if i ctrl+a in a browser's page and then ctrl+v in a notepad.

I was googled how to strip html string, but didn't find the good result.

Removing tag using regex: "<(.|\n)*?>" causes some problems:

* The html-table is not nicely converted to tabbed plain text. It produces *crazy* table in plain text.

* the html-alternate-image lost

* the list ( <ul> & <ol> ) is not conveted well. No numbering or bullets in plain text

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend