asp.net-mvc

Tags created dynamically with jQuery disappear after my form is posted

My page creates rows dynamically using jQuery but when I refresh the form, the rows are gone. How can I preserve the jquery dynamically created controls in MVC? It's a master detail page, I am creating a billing detail page. The details has a button which when you click it will show a dialog box asking detail info. After clicking ok on...

Binding a model without controller/http.context

I have a model called "Channel" which has a bunch of string properties. I fetch data from my data source which returns a hash table. The Keys of this table match the property names of my model. How can I auto-bind the hash table to the Channel model? The binders from ASP.NET MVC seem to do this but you need to use it in a controller w...

Help with asp.net mvc authorization

Im using asp.net mvc built in authorize filter. My only problem with it is that I dont want it to redirect my user to a login page when they dont have permission to perform a certain action... It always takes them to the login page even though ther are already logged on (but not with admin role).. I would like to be able to decide where ...

Help with asp.net mvc SelecList, Html.dropdownList and linqtosql

I have users table, it has id, name last name I have a linq to sql class I want a dropdownlist that has id for value and has NAME AND LASTNAME for text.... how can i do this? ViewData["User_Id"] = new SelectList(UsersRepository.GetAll(), "Id", "Name"); works just fine but I want ViewData["User_Id"] = new SelectList(UsersRepository....

Problem creating a custom input element using FluentHtml (MVCContrib)

Hi there, I just recently started dabbling in ASP.NET MVC 1.0 and came across the wonderful MVCContrib. I had originally gone down the path of creating some extended html helpers, but after finding FluentHTML decided to try my hand at creating a custom input element. Basically I am wanting to ultimately create several custom input elemen...

Upload File to Website Using Save/As From Software Application

We all know that it is possible to "open" a Word document (or file from any arbitrary application) by clicking on a website link and then clicking the Open button. I also know that, if I want to upload an application document to a web server, I must first save the document to my computer, and then go to an upload page, click a file/open...

Pen testing your MVC application

Here are some the commonly known practices for securing an MVC application: Encode your output Parameterize your SQL Test your search backwards and forward 1 way hash passwords Lock out accounts or limit login attempts Use code based impersonation when accessing the file system Access SQL with a locked down username Use Honey-pots or c...

Why does IIS6 Accept-Encoding value equal null when attempting compression with ASP.Net MVC

I have plugged in the HttpCompress module to enable compression for my MVC web application. If I run my site through the development web server (Cassini) I have no troubles with the execution of compression. However when I deploy the site to IIS6 the compression is not executing. I have checked the source code of the compression librar...

Modeling a many-to-many relationship in ASP.NET MVC using LINQ to SQL

I've been reading and watching videos about MVC and I'm starting to get a little confused. The simple tutorials are far too simple and they seem to only involve a single database table. Whoopty doo! The advanced tutorials assume a lot of knowledge is present and I have trouble following those. Not to mention, there are 15 ways to model ...

Error attempting to access a web service (hosted locally or externally), can't resolve host name

I'm stumped. I've got an asp.net mvc app being hosted on a shared hosting provider. The configuration of their system leaves a little to be desired, but it's cheap (getting what I pay for I suppose...) The problem is this: The application is hosted at the root level of the hosting account. I have a virtual directory established under...

QueryString id parameter not being used

I've got a very basic ASP.Net MVC project where I'd like to use a parameter name of id on one of my controller actions. From everything I've read that shouldn't be a problem but for some reason using a parameter name of id fails to get the value extracted from the query string but if I change it to any other different name it will work. ...

Error while using RequireHttps of MVC

I am using RequireHttps for my application to redirect t0 https when the user enters http by default. I have followed asp-net-mvc-requirehttps-in-production-only But after implementing this, i am getting the following error for each request: System.Web.HttpException: A public action method 'blank.htm' was not found on controller 'MyPro...

Asp.net MVC Secure Area

I'm just strating a new project in MVC and I need to have a backend that has restricted access. I was going to set up a group in Active Directory for users who have access rights and use the Authorize atribute on the backend controller to restrict access. I will also enable Windows authentication. I was just wondering if that would be ...

How to route a multiple language URL with a MVC

I need multi language url route of existing controller. let's explain more: I have a controller with name "Product" and View with name "Software", therefore by default if user enter "http://mysite.com/en/Product/Software" ,get right content (that really exist in http://mysite.com/Product/Software), but i need if other user (french user...

delay execution of statement until preveouus binding is still in progress (jquery, ajax)

in my page i am calling a controller using $.get with some parameters , that controller returns me a view page (.aspx), now, i bind that page to a different div every time as this function can be iterated (or called multiple times) these div s are already created and then result is mapped to each div function getview(Name, Paramete...

Crystal Reports CrystalImageHandler and MVC .NET

I am unable to show images in CR reports. I'm developing a MVC 2 project in VS 2008 with Crystal Reports that comes with it (10.5). Everything works fine, except for images. I can see them in the preview mode within the CR designer, but not when the app is deployed, which means I am loading data OK but something's wrong with IIS and/or r...

Fluent Nhibernate and MVC

I am trying to do a MVC project where i want to use fluent nhibernate. gonna use sql. unfortunately i am confused about how to even start it. i found no tutorials in the net. i need help in organizing my project.thanks in advance ...

Method not found: 'System.Web.Mvc.MvcHtmlString System.Web.Mvc.Html.LinkExtensions.RouteLink(System.Web.Mvc.HtmlHelper, System.String, System.Object)'.

I have a project that it had been developed under MVC1 and after aa few months ago I upgraded it in MVC2. Everything was well, uppon the day I needed to format my computer. And what can goes wrong with a format? I don't know Laughing I have installed the MVC2 after the formating,I import the existing project, I build it, and no error...

Why do I randomly get a "error to use section registered as allowDefinition='MachineToApplication'" when building an MVC project?

I have seen a few questions on SO about a similar error when deploying a website, but I seem to randomly get this error when building an ASP.NET MVC website in Visual Studio. Performing a clean usually fixes it, but is there any way to avoid this completely? It is an error to use a section registered as allowDefinition='MachineToAppl...

Traversing a nested LINQ query in of anonymous objects in C# view via ASP.NET MVC

Traversing a nested LINQ query in of anonymous objects in C# view via ASP.NET MVC Hi, done a lot of searching and reading but still require some specific information. I have the following code: List<DateTime> range = getRangeCollection(); var range = ( from years in rangeData group years by ye...