asp.net-mvc

Where to put data management rules for complex data validation in ASP.NET MVC?

Hello, I am currently working on an ASP.NET MVC2 project. This is the first time I am working on a real MVC web application. The ASP.NET MVC website really helped me to get started really fast, but I still have some obscure knowledge concerning datamodel validation. My problem is that I do not really know where to manage my filled data...

Render partial view with updated value.

I am working on asp.net mvc project using views and partial views. Multiple partial views are being rendered in single view. Now my problem is that when ever i update some values in partial view and render it again through controller it does not show partial view with updated value.... to see updated value i have to refresh the page each...

Custom BindAttribute

Is there a way to implement your own BindAttribute. Preferably by deriving from BindAttribute, but if you need to impliment it in your own ModelBinder how would you go about doing this? ...

How to update bulk users at one time...using asp.net mvc

Hello Friends, I have to update the users based on input value.. here is my code.. <fieldset> <legend>StudnetInfo</legend> here i have two textboxes and two dropdown list boxes.. this is the fiedlset user is going to enter their information.. </fieldset> on the same page i have couple of other Fieldset with there studentInfo with ...

How to deploy and secure an ASP.NET web app to be available to internal and outside users?

My company has several web applications written in ASP.NET. We need to make these applications available to Intranet users as well as authenticated external users. Most of the features are the same for the two groups, though there are some extra features available to the Internal users. The two different sets of users would use a slig...

Service Layer are repeating my Repositories

Hi all, I'm developing an application using asp.net mvc, NHibernate and DDD. I have a service layer that are used by controllers of my application. Everything are using Unity to inject dependencies (ISessionFactory in repositories, repositories in services and services in controllers) and works fine. But, it's very common I need a met...

MVC Routes - How to get a URL?

In my current project we have a notification system. When an oject is added to another objects collection, an email is sent to those who are subscibed to the parent object. This happens on the object layer and not in the View or Controller. Here's the problem: Although we can say who created what with what information in the email, w...

ASP.NET MVC is there an attribute for a ViewModel/Dto property which causes the modelbinder/view to ignore it?

I have a property in a dto that I don't want the modelbinder/view to use the get on? Is there an attribute I can decorate it with to stop them from interrogating it? Thanks ...

Architecture for new ASP.NET web application

I'm maintaining an application which currently is just a web service (built with WCF) and a database backend. The web service is built in layers with a linq-to-sql data access part with core functionality in an own assembly and on top of that the web service assembly which contains the WCF code. The core assembly also handles all busines...

SSL authentication error: RemoteCertificateChainErrors on ASP.NET on Ubuntu

I am trying to access Gmail's SMTP service from an ASP.NET MVC site running under Mono 2.4.2.3. But I keep getting this error: System.InvalidOperationException: SSL authentication error: RemoteCertificateChainErrors at System.Net.Mail.SmtpClient.m__3 (System.Object sender, System.Security.Cryptography.X509Certificates.X509Certificate ...

using MEF with NHibernate and windsor

I have an ASP.net MVC application that is using NHibernate under the covers for data access. I'm using the Windsor container to handle injecting ISession references into each controller. This works great, but now I'm looking to expand my application with a pluggable architecture so that I can have a core product and specific add-ons. ...

Using ASP.NET MVC, can I download a file using a jQuery GET and FilePathResult?

My app needs to download a file after the file has been cached and then download the file. I have one jQuery.post() cache the file and then call the following after the file is successfully cached: <script type="text/javascript"> function startViewingFiles(fileNames) { $.get( '<%= Url.Action(MvcTemplates.Document...

How to get the Focus on one of Buttons of JQuery Dialog on ASP.NET MVC page?

Hi I have an ASP.NET MVC page(Registration). On loading the page, i am calling Jquery Dialog with Agree and Disagree buttons on that Dialog. 1). How to set the focus to Agree button by default? 2). How to disable the X (Close) Mark that is on Top right corner? (So that i don't want the user to close that dialog simply). Code: $("#di...

jQuery show based on checkbox value at page load.

I have an ASP MVC web app and on one of the pages there is a set of Main checkboxes with sub-checkboxes underneath them. The sub-checkboxes should only show up when the corresponding main checkbox is checked. I have the following code that works just fine as long as none of the checkboxes are checked when the page loads. $("input[id$=Su...

Clean way to output values in ASP.NET MVC Views when value is not null

Is there a better way to write the code below? I have quite a few blocks that are similar, and this is making the code in the Viewpage very messy to work with. The data value with the associated label only needs to be output when certain conditions are met, which is almost always if the value is not null. The options I can think i...

if-else equivalent via linq-to-sql query in where clause c#

Hi guys, Basically I wanted to have an if-else statement in my linq to sql statement. var query = from d in database if(x == y) { where d.Attr = x } else { where d.Attr = y } select d; Any ideas? ...

Find out in Global.Asax - Application_Start if ASP.NET application running locally

Hello, HttpContext.Current.Request.IsLocal is not available in Global.Asax/Application_Start (Request is not available in the context). How else could I safely determine if my ASP.NET MVC application is started locally or not? This is to rewrite my web.config conditionally (depending on whether the application is deployed (remote) or ...

can I include normal asp.net pages (webforms or mvc) in a Dynamic Data web application

can I include normal asp.net pages (webforms or mvc) in a Dynamic Data web application? ...

how to handle this type of things. using asp.net mvc

hello friends, i have public jsonresult update(studentinfo s) { for(i=0;i>0;i++) { var x = // i am getting some x so i am checking again if( x != null) { var updateuser = student.update(s.student,"",""); **return json(updateuser.ToString());** // if i keep it here i am getting exceptoin saying n...

Pass a hidden jqGrid value when editing on ASP.Net MVC

I have a jqGrid in an ASP.Net MVC. The grid is defined as: $("#list").jqGrid({ url: '<%= Url.Action("History", "Farrier", new { id = ViewData["horseId"]}) %>', editurl: '/Farrier/Add', datatype: 'json', mtype: 'GET', colNames: ['horseId', 'date', 'notes'], colModel: [ ...