Category: ASP.NET MVC
-
MVC Zip Result
Sometimes you need to send to the user more than 1 file – or,maybe,the file is too large The simplest way is : made a zip file that contains the others. What do you need 1. SharpzipLib from http://www.icsharpcode.net/opensource/sharpziplib/ ( or download via NuGet in VS) 2. obtain the file(s) that you want as a…
-
ASP.NET MVC make users–roles fast
please left click on “Microsoft SQL Server Management Studio (push button)” please create a database in “Microsoft SQL Server Management Studio” please left click on “C:\Windows\system32\cmd.exe (push button)” and enter the following command : aspnet_regsql.exe -E -S .\SQLExpress -d proprii -A rm please left click on “ListPanel (list)” in “Microsoft SQL Server Management Studio” please…
-
mvc windows authentication
If you want to use Windows Authentication with MVC : Step 1 : In web.config,put authentication mode windows Step 2 : in IIS disable anonymous Step 3 : go to Views\Shared\LogOnUserControl.ascx and remove logoff / logon links.
-
Error intercepting in MVC when saving data
I have seen many times in MVC the following code,when doing a post and saving data : Why is not good ? I will do a simple example : if some error occurs on the database level ( such as simple unique index on a name column ) or even some error occurs whenestablishing the…
-
Five common mistakes for ASP.NET (MVC) accesing resources : css,js,images,ajax
To have once for all the link to show to people,because too much makes the same error again and again. (From here – you can use ResolveUrl or Url.Content – it’s the same for me. I use ResolveUrl because I used first …) Case 1 The image does not display Please check you have the…
-
My standard way to work with dropdown box in ASP.NET MVC – 2 steps (or 3 if you want to add long description)
I have written a small post about dropdownlist template in ASP.NET MVC here : http://msprogrammer.serviciipeweb.ro/2010/05/30/mvc-helper-templates/ I think that the dropdownlist should be explained more – aand the example will be : First,let’s say we have Employee and Department. And we have Employee that has a field,named IDDepartment. When edit/create a user we want to display…
-
ASP.NET MVC pass data from a view to master
One of recurring questions in MVC is how to share data between views and master. The question must be reformulated : how to share data between ACTION and master. The short answer is : Model of the View returned from Action have to put some data to the Model of the Master The long answer…
-
ASP.NET MVC editing fast a property
There are some moments when you want to fast edit a property ( like a status or a name) and you do not want to load the entire “Edit” form for this.More,you are in an edit formula and do not want to add a form. So here is the solution in ASP.NET MVC with jquery-1.4.2.min,jquery-ui-1.8.1.custom.min…
-
Asp.NET MVC and DOS – re-using the ViewModels
(Please read first : http://msprogrammer.serviciipeweb.ro/2010/03/29/asp-net-mvc-orm-and-viewmodels/ ) One of the biggest challenges in programming was write once- GUI everywhere ( Ok,ORM impedance mismatch is another story) I mean by that re-using the logic from an application in another application. ASP.NET MVC,with the commitment to strongly viewmodels,make me think that it will be now easier to transfer…
-
MVC Helper Templates
In my experiences with MVC I have some utilities to share . Some of them are : DateTime fields Numeric fields Watermark Dropdownlist more! Please see the project and give feedback MvcHelperApplication