asp.net-mvc

Pass mvc form post data to an asp page.

We are doing a old section reskin which is written in classical asp and it is being remade in Asp.net MVC. Content of some of the pages just needs to be pulled into a new layout. So I have written a helper method that basically reads asp file and renders contents in the current view. public static string readHtmlPage(string url) ...

How do I require asp.net forms authentication to send a validation email when registering a new account?

I have just set up a new ASP.NET MVC website and I would like to change it to force the user to authenticate their email address by clicking a validation link in an email. I googled the answer with as many search terms as I could think of, but I guess I never hit the correct one. I started playing with the membership objects to see wha...

How can I inherit an ASP.NET MVC controller and change only the view?

I have a controller that's inheriting from a base controller, and I'm wondering how I can utilize all of the logic from the base controller, but return a different view than the base controller uses. The base controller populates a model object and passes that model object to its view, but I'm not sure how I can access that model object...

MVC 1.0 Ajax.BeginForm() submit inside an Html.BeginForm()

I have a View for creating a new account in my aopplication. This view starts with Html.BeginForm() and hits the right controller (Create) no problems. I decided to add an Ajax.BeginForm() so that I could make sure an account with the same name doesn't already exist in my application. When I click the submit using either button it go...

How to get Keywords used from a Search Engine

I am using C# asp.NET and I have searched the internet up and down trying to find a solution to this problem. In google analytics they have the keywords used by search engines so there must be a way to do it. thanks ...

Redirect After Post in ASP.NET MVC

I am using the Redirect After Post pattern in my ASP.NET MVC application. I have the following scenario: User goes to /controller/index where he is asked to fill a form. Form values are POSTed to /controller/calculate. The Calculate action performs calculation based on input and instantiates a complex object containing the results of t...

'New' and 'Create' RESTful action names or 'Create' for both in ASP.MVC

The rails convention is to use New and Create for RESTful action names. The .NET MVC convention appears to be to use Create for both (usually with a post restrictor on the action intended to the true 'Create' method). Personally I would prefer to use New and Create in .net but have been using Create for both given the convention. What (...

populate selectlist with json data in JQuery when the selectlist is loaded (not the document)

hey guys, I have a button on a form that is dynamically spawning a select list, which is supposed to be populated with json data, i have all of the json data being pulled in correctly my only issue is hooking the selectlist's onload event to fill itself with data, i know i could use $('#itemID').fillSelectlist() to fill it but the probl...

Allow special charcters in IIS request URLs

Currently, when I try to hit certain pages of my site via something like http://www.domain.com/&lt; (which is a valid URL), I get a blank page with the text "Bad Request" on it (and nothing else). This happens with both the escaped and unescaped version of the URL. I'm fairly certain this is due to IIS6 not liking the < character (whic...

Using LLBL as Model in MVC

I have settled on trying to use ASP.NET MVC but the first part I want to replace is the Model. I am using LLBL Pro for the model. I have a table called "Groups" that is a simple look up table. I want to take thhe results of the table and populate a list in MVC. Something that should be very simple... or so I thought.... I've tried...

How to debug ASP.NET MVC Controller after it passes control to the View?

About once every 20 page loads, I get a glitch in my View. I'd like to know what values the variables in my Controller contained right before it called the View. However, once the View is called I lose all local variables from the Controller. Is there any hope? ...

Using the aspnet_compiler.exe to compile .Net Web Apps

I have code in the top layer of my .Net web application that I'd like to unit test, but when my build server compiles the project using the aspnet_compiler.exe, it makes a .dll file that is not at all usable by another project, i.e. an NUnit test project. (This is true of ASP .Net web applications and of ASP .Net MVC applications.) Am ...

How do the examples in ASP.NET MVC in Action avoid specifying the proxyfactory.factory_class when using NHibernate 2.1

I realize that NHibernate 2.1 removed its dependency on the Castle Project. In fact, Joshua Ewer did a great post summarizing the necessity of a proxy factory for an NHibernate implementation. Presently, I am working through the examples in ASP.NET MVC in Action by Jeffrey Palermo and am confused. The source code examples for both the C...

ASP.NET MVC: returning plaintext file to download from controller method

Consider the need to return a plain-text file from a controller method back to the caller. The idea is to have the file downloaded, rather than viewed as plaintext in the browser. I have the following method, and it works as expected. The file is presented to the browser for download, and the file is populated with the string. I'd lik...

Render Partial View Using jQuery in ASP.NET MVC

How do I render the partial view using jquery? We can render the partial View like this: <% Html.RenderPartial("UserDetails"); %> How can we do the same using jquery? ...

Deployment projects for multiple sites

I have 7 sites that should be deployed to my DEV server, then to my QA server and in the end to the PROD servers. Currently everything is done manually, but it's a chore. Today I looked at the Deployment solutions, but it seems it's one deployment solution per site. Is there a way to have multiple sites deployed with one action? ...

asp.net mvc website issue

I have converted my asp.net mvc project to asp.net mvc website. Everything works find under IIS but under Cassini it doesn't resolve the URLs, even tough it does it when its an MVC project !! What could be wrong ? ...

How to use Html.Encode with Html.Texbox in Asp.net MVC?

How to use Html.Encode with html helper in ASP.NET MVC to prevent javascript injection? For instance with: <%= Html.TextBox("Name") %> ...

autocomplete in jquery

I am using autocomplete feature in jquery to show the users list intellisense. for formatItem, i am using FirstName + " " + LastName + " [" + EmailAddress + "]"; for formatResult, i am showing FirstName + " " + LastName I need to get the selected users userid, how can i get in autocomplete feature? Say, I have a textbox to enter the n...

ASP.NET Bind to IEnumerable

Hi, I'm passing a the type IEnumerable to my view, and for each item I output a html.textbox to enter the details into. When I post this back to my controller, the collection is empty and I can't see why. public class Item { public Order Order { get; set; } public string Title { get; set; } public doubl...