asp.net-mvc

Updating multiple DIVs via AJAX is inconsistent

I have an ASP.NET page that contains three DIVs, each of which is initially displayed via partial page includes - this works fine. Each DIV contains a grid of entries that can be paged through or sorted by a particular column. These updates are done via AJAX requests and this also works just fine. My problem occurs when carrying out th...

Tables from 2 databases in one LINQ to SQL class

I want to include a table (Events) from another database in my LINQ to SQL class. How should I format the Data Source of that table? I have tried with IP.dbo.Events, IP.DatabaseName.dbo.Events and so on, but can not get it to work. The reason for all this is to select Events that a Client have attended. I have also tried to have the ...

Link to same URL - less one parameter in ASP.NET MVC

In a creation (or edit) form I use helpers and partials to display either a DropDownBox or a summary for categories, vendors or whatever other model the object refers to. Example: Products/Create?category_id=1&vendor_id=1 shows a summary for Category and one for Vendor, while Products/Create?category_id=1 shows a summary for Category an...

Language dependent routes in ASP.NET MVC

Has anyone had any experienced with making language dependent routes with ASP.NET MVC? What I would like to do is have localized url's to improve SEO. So for example http://mysite.com/products/cars would map to the same controller/action as http://mysite.com/produkter/bilar? I have tried browsing around a bit, but I could not find anyth...

What is the correct .NET_Folder to store required DLLs references?

VisualStudio 2008 has a few options when it comes to ASP_Folders (ASP_GlobalResources, ASP_LocalResources, ASP_DATA, etc). I have a few dependency DLLs like (DotNetOpenAuth) that I will like to store in SVN so that when people checkout the solution they don't have to install anything in their development machine. ...

Why isn't information about the openID user coming through the protocol?

I am using DotNetOpenAuth to integrate openID in our web application. The code below requests the information to the provider. try { var req = openid.CreateRequest(Request.Form["openid_identifier"]); req.AddExtension(new DotNetOpenAuth.OpenId.Extensions.SimpleRegistration.ClaimsRequest { Email = DotNetOpenAuth.OpenId.Extensi...

What is the difference between <% %> and <%= %> in ASP.NET MVC

Possible Duplicates: What is the difference between <% %> and <%=%>? C# MVC: What is the difference between <%# and <%= I'm so confused with this. Please explain the difference between this if possible.. What is the significance of that "=" there? Edit:Thanks for all your answers.Please understand that It was hard to get an...

SubSonic 3.0 Simple Repository Adding a DateTime Property To An Object

I am trying out SubSonic to see if it is viable to use on production projects. I seem to have stumbled upon an issue whith regards to updating the database with default values (String and DateTime) when a new column is created. If a new property of DateTime or String is added to an object. public class Bug { public int BugId { get;...

ado.net entity framework delete rows

Hi, I may be completely blind and stupid, but I cannot find any method generated by ADO.NET Entity Data Model that would somehow delete rows from my table. I didn't want to create a custom query. So how do I do that? Please help. I don't have the method DeleteOnSubmit... don't know why. This is the code I wanted to use. var deleteOrder...

Finding the controller that called my controller; or traversing the Controller/Action stack.

I'm using Html.RenderAction, in ASP.NET MVC (futures), to display modules on different pages. I want the modules to be aware of which page they belong to (for settings and logging purposes). Is there a way to get the Controller/Action - stack, on the current controller? I found on the Controller base something called DescriptorCache un...

ASP.NET MVC Session using jQuery

PROBLEM SOLVED: I was overlooking a very simple issue, and that is that this is actually two different apps running under one website. I modified the URL in the AJAX call slightly to reflect that and the problem is no longer happening. ORIGINAL QUESTION: I'm having a weird issue and I'm hoping someone can help shed some light on the s...

Rules Validation on Data or Domain layer?

Hello, I've been reading Pro ASP.NET MVC Framework, Steven Sanderson, and in chapter 11 it discusses data validation. On page 390 we see the section Moving Validation Logic into Your Model Layer. In this section we see, in page 392, some code showing how to implement validation. The code implements a GetRuleViolations() method and the ...

Total Silverlight/ASP.Net MVC noob question!

Hello! So i've recently got into Silverlight development. So far i've managed to create a single Siverlight XAML view which pulls in data from an SQL Server Database using the ADO.Net Entity Framework and displays the data in a Silverlight DataGrid. I can also perform simple editing and update functionality on the data and persist it bac...

How to get Checkbox status?

I have following html control in view: <%= Html.CheckBox("MyStatus", (item.MyStatus>0)?true:false)%> Then I want to get the value for this checkbox: if it is checked, return true, otherwise return false. I try it as below: $("#MyStatus").attr("checked").value but I can't get the right value. How to resolve it? ...

Asp.NET MVC Custom Validator For a View Model?

I am using custom view model classes as DTO objects to hold data for display on my View pages. I have applied validation via the DataAnnotations library to perform server side validation on the properties of these classes. Here is a simple example: [DisplayName("Customer Account Id")] [Required(ErrorMessage = "* Account Number is requir...

Check for SSL and forward to it

This is simular to this question: But I want to do it within the MVC where the "Request" object isn't directly accessable. Is there a method decorator to specify actions that require SSL? How do I get the equivalent of the answer in the mentioned answer within the MVC? If Not Request.IsLocal AndAlso Not Request.IsSecureConnection The...

Asp.net Mvc FormsAuth with LogonUserControl in Site.Master

We have an email confirmation page for registration which can be hit with a use-once link to activate the account. The nature of the site is such that we can allow this link to log the user in automatically. This requirement is under review (at my request!). The following situation is proving a little confusing: The user follows the...

Insert record with Subsonic 3.0

Hi! I have an issue with subsonic. I'm trying to insert a record into table with primary key set to identity with autoincrement. I've got an exception: Cannot insert explicit value for identity column in table 'Zaposleni' when IDENTITY_INSERT is set to OFF. How do I do this? Please, can anybody provide me an example? I should mention...

Why is there no internal Controller redirect in ASP.Net MVC (or CodeIgniter)?

ASP.Net MVC Controllers have several methods of forwarding control to another controller or action. However, all of them cause a client redirect, with a 302 and a new browser request. Why is there no internal "call another controller's action" functionality, without getting the client involved? I'm pretty sure that the php CodeIgniter...

Route to controller

I have a controller called Admin with a number of Actions. In the URL, they look like this: http://www.website.com/Admin/Users/1 http://www.website.com/Admin/Roles/123 Is there anyway to alias out so that: http://www.website.com/Users/1 http://www.website.com/Roles/123 Automatically goes to the right controller? Regards. ...