You must Sign In to post a response.
  • Category: ASP.Net MVC

    Different views for different state to be created?

    Say i have 5 states in my project, all these states has same view. But for now, only 2 states related code changes are delivered. In this case should i have separate Views for all different 5 states? or is there any other way?

    Thanks in advance
  • #768605

    Kindly explain what view you are indicating about. Is that View in SQL Server which you are using in .NET
    Or Viewstate which you are mentioning as View.

    The View I guess you are mentioning about the SQL. In that case View ,

    FROM Products
    WHERE Discontinued=No

    Now we can use this ListA for all the 5 columns we selected.

    Select * from ListA

    If you want only two column you can make simple changes in the view,

    Select (specify Columns) from ListA


  • #768606
    I selected the category as MVC, i thought its understood as MVC View [UI]. Sorry for the confusion anyway. I need information about mvc view [UI]

  • #768607

    Thanks for that, Now understand that it was about MVC View Folder.
    so you have view folder like below
    State 1.cshtml
    State 2.cshtml
    State 3.cshtml
    State 4.cshtml
    State 5.cshtml

    Out of this only two files you are deploying right.
    We have option call hide, which you can hide those 3 state file and deploy the application.

    Keeping all 5 state file and deploying application will not affect anything because you are calling 2 states only. But those 3 file will be extra files for your application while you deploy.

    Simple thing you can do is, after deploying application in the deployed folder remove those 3 files and publish the folder in the IIS Server. So we don't need to change anything, in future if you going for all the 5 state release it will be easy for you to keep the same folder structure.


  • #768610

    As per my understanding previously you have common view for all the 5 states, now you have been modified 2 states as per your requirement. In this scenario keep the existing view for rest of the three states and create new view for recently modified 2 states, i.e. overall you have been used 2 views one is for modified states and another one is for not modified.

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • Sign In to post your comments