Hi Guys,
I'm using the S#arp architecture, and I can't remember where I read it, but they say they ViewModels should be stored at the service layer, and your views should submit the viewmodel to the service for processing.
My question then is this. Which layer should construct the ViewModel? Should it be at the service layer, and the ...
I've been getting some inexplicable errors (running out of connections from the connection pool) with MySql database with .Net 4 (C#). Till now all my attempts at finding a reason for this have been in vain. Now I also have a situation in which a lock on a table is not cleared for a long time even though all I have been doing is read ope...
Hello.
I'm building ASP.NET MVC2 application, and using Entity Framework as ORM. I am having troubles updating object in the database. Every time I try entity.SaveChanges(), EF inserts new line in the table, regardless of do I want update, or insert to be done. I tried attaching (like in this next example) object to entity, but then I g...
I'm trying to write my own Custom Validation attribute but i'm having some problems.
The attribute i'm trying to write is that when a user logs in, the password will be compared against the confirmation password.
namespace Data.Attributes
{
public class ComparePassword : ValidationAttribute
{
public string PasswordToCompareWith { g...
I Have Make a Create Form.
& I want the Values in Controller how can I get them Without Postback the Whole Page?
Any article please help
...
Hi!
I'm doing client side validation on a project I'm working on. Everything works, except for the minimumlength property of the StringLength attribute (it works when submitting and a serverside validation is done):
[StringLength(50, MinimumLength = 6)]
The javascript generated by Html.EnableClientValication(); is the following:
// ...
I want to have a modal popup that may also have validation upon post. Can I have an example please.
...
Hi all,
I've create an asp.net MVC 2 project, it works fine!!
I've been asked to integrate the project in an existing web project in classic asp.net
(I've add the folder containing the source, and not make a new project, because they have to bee in same project)
I've configured my web.config file
<pages pageBaseType="System.Web.UI.P...
I'm trying to separate the default AccountModel in mvc2 into a separate interface and repository.
I've created an Interface and Repository and copied over the code from the AccountModel.
I can register users and create accounts but in Visual Studio I'm getting the error below on the AccountController (* below).
Error 1 Inconsistent ac...
If I'm deploying an asp.net mvc app, do I need to sign my DLLs? They won't be placed in the GAC.
...
Hi,
I want to send an array of objects in the get request string. I know this isn't the optimal solution, but I really just want to get this up and running.
If I have a class, something like this
public class Data
{
public int a { get; set; }
public int b { get; set; }
}
public class RequestViewData
{
public IList<Data> MyDa...
How can I create a "security aware" action link that detects if a user is authorized to click (invoke) the action?
Hide link if user is not allowed to use that action...
Depending from
web.config (authorization) and
[Authorize] attributes on actions
PS
I guess it is bad practice to mix those 2 in MVC?
...
Hi guys,
I recently bought some webspace with dailyrazor.com. I have deployed an application I have been working on to the server and am currently trying to workout the bugs but I can't seem to solve this one.
I have set up my database in Visual Studio to use the one I have create with dailyrazor the same db the deployed version will u...
I have a series of links and when i click on a link i want to show a dialog with detail information. This detail is returned from an jquery ajax request.
I am using the following code below to show a partial result through ajax onto a jquery dialog.
Here is the jquery code:
$(document).ready(function() {
$('a.click').live('click', ...
Is there any ajax toolkit for asp.net MVC
...
My controllers all extend a basic UserAwareController class, that exposes GetCurrentUser() method. I would like any call to this method to redirect to the login page if the user is not already logged in.
Can I accomplish this by throwing some exception from this method? How can I cause a redirect to happen when this exception is thrown?...
I am finally experimenting and trying to learn MVC after years of asp.net.
I am used to using asp.net AJAX PageMethods where you can pass an object that automagically gets parsed to whatever type the parameter is in that method.
Javascript:
PageMethods.AddPerson({First:"John",Last:"Doe"});
Code-Behind:
[WebMethod]
public static Resu...
Hello guys, I have an ajax form that saves a object in the database then return a Message like this:
return Json(new {Message = "Message!"},
JsonRequestBehavior.AllowGet);
We are ok here, but I don't know HOW I'll get this result in the view to display in a jQuery modal. My ajax form is like the following a...
First of all, I've checked out all the SO threads, and googled my brains out. I must be missing something obvious.
I'd really appreciate some help! This is what I've got.
UploadController.cs
using System.Web;
using System.Web.Mvc;
namespace NIMDocs.Controllers
{
public class UploadController : Controller
{
public Acti...
I have a simple model FilesModel for updating a string Description and the boolean value of a checkbox Archived for a few (already uploaded) files, and FilesModel has a validator FilesModelValidator that gets run when this data is posted. This validator does nothing more than check that each file has a description. I know that it runs an...