Last post Dec 22, 2010 05:09 AM by shwetamber
Dec 21, 2010 06:19 AM|Mayil_Gilli|LINK
I have the 60 pages and 60 tables in my project. Each page has the grid, each grid has the common actions as follows Show the existing record , add new record , update the record, delete the record .
Each page refers different tables so that we have written the code for separately for each page.
My questions as follows
Dec 21, 2010 06:39 AM|shwetamber|LINK
You can Use MVC Architecture for avoid code redundancy. It is easy to understand and reuse. In short- Create the public class in your App_Code Folder and Create Insert , Update , Delete And Select Methods in it . At the front end call the appropriate method
from your page.
Thanks & regards
Dec 21, 2010 07:39 AM|Mayil_Gilli|LINK
Thanks a lot for your reply . I will try to create the MVC architecture . do you have any samples please upload.
Dec 22, 2010 01:42 AM|shwetamber|LINK
Please Download the sample code from here.
Let me know if you have any doubts .
Thanks & Regards
Dec 22, 2010 04:35 AM|Mayil_Gilli|LINK
Thanks a lot for your reply. Before I go to MVC I need the following information
Dec 22, 2010 05:09 AM|shwetamber|LINK
>> What are all the unique advantages in MVC application?
1) It is an good approch to communicate with Database server. Write your connection string in Web.Config file. In case if database path will change then you will no need to change connection string in every page. Just change in Web.Config and It is apply
to all methods.
2) In the Controller class and AdminManager Class, You will ensure that connection and SqlTransaction will be closed . This will overcome the Connection pooling problems in Asp.net .
3) In the AdminManager class the command object will be resused if it is not disposed. It Saves the Memory in ASP.net . Otherwise too many objects will initialised in buffer and they will not used in project.
4) Your website performence also incresed.
5) Using the Properties instead of direct variables will create security in Your Code.
>> How about server installation? Is there any special instructions to deploy the files in server?
No need the server installation. Just put the App_Code Folder in your website. If you deploy the whole source code on hosting server then App_Code folder will not change. If you published your website the App_Code folder will compiled and added to your bin
You doesn't need to do anything extra.
>> I need some sample programs to under stand the MVC.
I had sent you the sample application. Change your connection string in web.Config and write the query in AdminManager.cs Methods. Run the application and put break points. You can see what happening between classes.