asp.net-mvc

Getting events on delete and paste in textbox jquery

I am using jquery on asp.net mvc. I have textbox on page and I hooked up handler for keyup event of textbox. When user deletes the text or pastes text into it, i do not get the handler called. Please help me how to handle this. EDIT: Also I want to get the value when user pastes the value using mouse. ...

[Asp.Net MVC] Encoding a character

Hi, I am experiencing some weird encoding behaviour in my ASP.NET MVC project. In my Site.Master there is <div class="logo"> <a href="<%=Url.Action("Index", "Win7")%>"><%= Html.Encode("Windows 7 Tutoriál") %></a></div> which translates to the resulting page as <div class="logo"> <a href="/">Windows 7 Tutoriál</a></d...

Why does not Asp.net mvc application work on Asp.Net Classic Application Pool?

I have an Asp.Net MVC 2 web application deployed on IIS 7.5 on .Net 4.0. When I select application pool as Asp.Net v4.0 Classic I get the following error. HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory. The same application works fine when I select application pool as Asp.Net v4.0...

Is ASP.NET MVC is really MVC? Or how to separate model from controller?

Hi all, This question is a bit rhetorical. At some point i got a feeling that ASP.NET MVC is not that authentic implementation of MVC pattern. Or i didn't understood it. Consider following domain: electric bulb, switch and motion detector. They are connected together and when you enter the room motion detector switches on the bulb. If ...

file upload working in one and not the other help

Hi All, I have a web application which has 2 different versions deployed. 1 is an ASP.Net web forms version and the other is an ASP.Net MVC version I have a File Upload page which dynamically creates a directory folder for the target location of the file to be uploaded to. The application is using Forms Authentication for outside user...

When exactly to use UrlEncode?

I am passing a return Url to a controller, but i am not using an mvc helper ie actionlink. before I redirect from the controller with this url should I use Server.UrlEncode? seems not to work properly. ...

Can classic asp and ASP.NET MVC run side-by-side on the same site?

Just a quick question. I suppose I could just try it but I like StackOverflow because of the quick responses and the comments from people more experienced than I am. Can classic asp and ASP.NET MVC run side-by-side on the same site? For example; the site might run a CMS written in ASP.NET MVC but need to seamlessly integrate with a cart...

Setting a default value -- presentation logic or business logic?

Hi, I was wondering if setting a default value for a SelectList is considered to be presentation logic or business logic? For example, if a requirement is that an Employee cannot be saved without a Location, but 99% of the time the location that would be selected is a particular item -- say Atlanta. Because of this, the location Selec...

How can you share a master page between 2 different projects/apps in ASP.NET MVC?

Is there a way to share a master page between different MVC projects/applications? We have several different applications, and would like those apps to share a similar header and footer on the web pages. What is the best approach to handle this situation with ASP.NET MVC? ...

.NET-MVC - Rewrite URL's + certain URL's through SSL?

I have a webserver running IIS 6, .NET MVC with a single domainname. The site uses URL rewriting to produce URLs like: domain.com/controller/action I would like to force one (1) controller to use SSL (others should work without SSL). How should I implement this? ...

How can I write extensions for Session without having to write separate methods for HttpSessionState and HttpSessionStateBase?

I wrote the following extension methods for Session so that I can persist and retrieve objects by their type. This works well for my solution, but I ended up having to duplicate my extension methods to cover the old HttpSessionState and the new HttpSessionStateBase. I'd like to find a way to get these back down to one set that covers bot...

.NET MVC - Where to check IsInRole() in Global.asax?

In which part of the Global.asax lifecycle can I safely 'use' the User object? I'm using the default forms authentication and noticed the following: Sub Application_BeginRequest() 'Context.User Is Nothing End Sub Sub Application_AuthenticateRequest() 'Context.User Is Nothing End Sub Sub Application_AuthorizeRequest() 'Cont...

Using Profile and CreateUserwizard in ASP.NET MVC 2

Hello, I am using this tutorial to create an application in ASP.NET MVC 2 where I can register users with custom profile properties using the CreateUserWizard control. My problem is that the tutorial uses ASP.NET (not MVC) and it needs the code-behind of the control for handling the CreateUserWizard1_CreatedUser method. Since in ASP.NE...

Proper Way to Update Production Server with new Compiled MVC Application Files

Ok, please bear with my noob question here. I'm doing the simple task of making an update to my mvc application, compiling it and then moving in onto the production server. I just wan't to know the best way to upload the compiled files. I have a single application pool, use ftp to upload the new application files and the site points t...

Adding check boxes to each row on MVCcontrib Grid

How can I add a checkbox to each row of a MVCcontrib grid. then when the form is posted find out which records were selected? I Am not finding much when searching for this. Thank you ...

How do you fight against all these ways? -Javascript and its million different ways you can write it

Hi I just don't know what to think anymore. It seems like the people who made javascript went out of their way to allow it to be written a million different ways so hackers can have a field day. I finally got my white list up by using html agility pack. It should remove <scrpit></script> As it is not in my white list plus any oncli...

ASP.NET MVC ViewData and view model best practices

The initial situation is that I map my domain model into a presentation model. I have to display an update/create formular with textboxes and a dropdownlist. Should the viewmodel contain a list for the dropdownlist or should I pass the data for the dropdownlist by using ViewData? When schould I use ViewData and when don't I should use...

Html Encode on a string with symbols

Hi all, How do I encode a string with symbols like ', & @ #' in ASP.Net MVC? I have tried to use Html.Encode, but it returns '', how do I return a string as the user input? Thanks alot. ...

Form to add products to the database on asp.net Mvc2

Hello, Its my first time with asp.net MVC 2. Im came from asp.net webforms. I would like to know how to build a form to add products (for instance) to a database with client and server validation. Do you have any url useful that explains this? Thanks in advance. Best Regards. Josema. ...

Dynamic content in static content

I have got simple module in my asp mvc page where can I generate some static html content from database. For example <% RenderAction("Article", "Article", new { articleId = 1 });%> returns (PartialViewResult) <ul> <li><a href="someurl">Hello worlds</a></li> </ul> I would like to have possibility to use Url or even Html object...