asp.net-mvc

form with multiple upload but allow no upload on edit problems

hiya i have a section that when created takes in images, however when you edit this item i dont want them to re-upload none changes images just to change a description or name. i have created this that deals with uploading files: public void UploadFiles(string currentFileName, FormCollection form) { // loop through all files in ...

What Patterns Should I Consider For a Html Widget Generator?

I'm looking to see if I can design a HtmlHelper extension method that will generate the Html for different types of widgets I want to produce. Each different type of widget implements functionality to get and prepare any data it needs to render. Can anyone suggest any patterns I could refer to for approaches to take? I know there are ...

OpenID token from Google (using www)?

I've come across the following situation when using OpenID and Google as the authenticator. If you type siteName.com it takes you to http://sitename.com Which returns a different token than if I were to login to www.siteName.com, which would take me to http://www.siteName.com As a result, Google returns a different authentication toke...

Suggestions for Single-Page Web Application Design?

My view is that unless you need to change the basic structure of the user interface, you should not have to reload the page at all for any user interactions. I'd like to approach my next ASP.NET MVC project with this in mind. Can anyone suggest any principles, patterns or practices* I should consider? Excellent book, btw. Still tryin...

asp.net mvc - limit access to web pages

Greetings, in my asp.net mvc application what i would like to do is to enable access to some pages only after user was successfully authorized. I have already created custom membership provider and that works fine. How can I, in web config create such rule - for instance for all pages in ~Admin/ folder? I don't want to create on every c...

How to make UPDATE queries in LINQ to SQL?

I like using LINQ to SQL. The only problem is that I don't like the default way of updating tables. Let's say I have the following table with the following columns: ID (primary key), value1, value2, value3, value4, value5 When I need to update something I call UPDATE ... WHERE ID=@id LINQ to SQL calls UPDATE ... WHERE ID=@id and ...

Problem Routing domains subfolder

Hi there, I'm pretty new to ASP.NET MVC and I hope it is not a too silly question. So here it comes. I have ... a ASP.NET MVC application with a domain similar to http://mydomain/mysubfoler1/myappfolder My problem... the routing of my application (it worked fine without using a subfolder after the domain-name). The applications ...

Properly registering JavaScript and CSS in MVC 2 Editor Templates

How do I properly register javascript blocks in an ASP.NET MVC 2 (RTM) Editor template? The specific scenario I'm in is that I want to use Dynarch JSCal2 DateTimePicker for my standard datetime picker, but this question is in general to any reusable javascript package. I have my template working properly now but it has my JS and CSS inc...

asp.net mvc get current logged in user id

Greetings, I have created a custom membership provider to make it possible to authenticate users on my application. How can i retrieve current user id in controller? I need this to get some data from database for this user like this: PersistanceManger.RepositoryUser.GetInformation(userROWGUID); ...

How do I display a FileStreamResult image in the view?

I passed a FileStreamResult image to a View. How do I render the image? ...

How do I create a selection list using checkboxes in ASP.NET MVC?

I have a database table that records what publications a user is allowed to access. The table is very simple - it simply stores user ID/publication ID pairs: CREATE TABLE UserPublication (UserId INTEGER, PublicationID INTEGER) The presence of a record for a given user & publication means that the user has access; absence of a record i...

How do I send an XML document to an ASP.NET MVC page for manipuation

I have some hierarchical data stored as an multiple XML files on the server according to a vendor's schema. In my ASP.NET MVC (2!) application, I'd like the user to choose one of these hierarchies (i.e. file -- I provide a list in my controller's Index action). When the user selects one to "edit" my edit action should return a page tha...

.NET MVC Ajax Form - How do you hide it?

Ok, everything is 'functionally' working with what I am attempting to accomplish and once again, I am sure this is something dumb, but I cannot figure out how to do this one thing. I have an edit form for an entity, lets say a car. This 'car' can have 0 - many passengers. So on my edit form, I have all the fields for the car, then a l...

ASP.NET A/B Split Testing

Does anyone know of any good resources (books, articles, existing software, etc...) for learning how to implement A/B split testing in ASP.NET? ...

Intellisense not working for ViewModel for MVC2 project in ASP.NET MVC2 RTW

I upgraded to MVC2 RTM with VS2010 RC and some of my ViewUserControl and Page controls don't show intellisense for simple things like <%= Html..... %> or <%= Model... %> ...

NHibernate: No persister error

Hello, In my quest to further my knowledge, I'm trying to get get NHibernate running. I have the following structure to my solution Core Class Library Project Infrastructure Class Library Project MVC Application Project Test Project In my Core project I have created the following entity: using System; namespace Core.Domain.Model ...

ASP.NET MVC: Have total control over the URL

Hello, I am developing a website that has nested categories. I would like the categories to be in the url such as something like this http://www.dmoz.org/Computers/Programming/Component_Frameworks/NET/Chats_and_Forums/ as you can see in the above url the categories are in the url itself. How can I develop something like this in asp.net...

MVCContrib input builder vs MVC 2 editor templates.

Is there any comparison? Pros and cons? ...

Using RouteExistingFiles to block access to existing files even if no route exists

In ASP.net MVC 2, I can use routes.RouteExistingFiles = true; to send all requests through the routing system, even if they exist on the file system. Usually, this ends up hitting the "{controller}/{action}/{id}" route and throws an exception as the controller cannot be found. I do not want to use that route though (I have only a few U...

Facebook Developer Toolkit doesn't redirect after authorization

I have a small facebook test app (iframe) based on sample http://blogs.claritycon.com/blogs/kevin_marshall/archive/2009/10/06/facebook-developer-toolkit-3-0-asp-net-mvc-sample.aspx public class HomeController : Controller { public ActionResult Index() { var api = this.GetApi(); var userId = api.Session.UserId; ...