asp.net-mvc

Performance questions about asp.net mvc(partial views and html helpers)

Hi I am just wondering how much of a performance will you lose by using lots of partial views and html helpers in an asp.net mvc application. Like I know html helpers are to be light weight but I can't see them rendering as fast as if you just made straight html. Don't get me wrong I love them but just curious on how much they would i...

Long running process that will return a file.

Hi, I'm using ASP.NET MVC and have a long running process. Specifically I am generating a large PDF for the user to download. I understand the basic concept: Action method gets called New thread started to generate process Return a View that tells the user the (pdf) is being generated Use AJAX to call the server and ask for progress ...

What's the point for UpdateModel to take values from RouteData and QueryString?

I've asked here about how to remove RouteData and QueryString sources from ValueProvider. And this question came out: When does the UpdateModel needs values from RouteData and QueryString? Why this is left as default feature? I see point to use RouteData and QueryString to call the correct controllers methods and provide parameters for ...

Back button functionality using ASP.net MVC

I have a requirement which needs me to redirect an user to previous page on his browsing history. I am using ASP.net MVC 1.0. I do NOT want to use javascript to achieve this. Any pointers? ...

How could I make this query - LINQ to SQL ?

I have two tables like this Table Product ProductId - int <PK> ProductExpiry - TimeDate AlertOfExpiry - int ProductTypeId - int<Fk> Table ProductType ProudctTypeId - int <PK> Name - varchar(50) Now I want to get a list of products that will expire soon. So what I am trying to do is Say todays date is today August 24 and an expiry...

How to stream Chart Images as FileResult from MVC Controllers update via jQuery Ajax

I am experimenting with Nic's method of streaming images as FileResult from controllers. CodeProject article. I thought I take it a step further and have an image get updated via jQuery. I have tried all sorts of ways but can't get the image to show. In this current state I am seeing all the characters of the PNG, I think it is sending ...

How do I create SEO-Friendly urls in ASP.Net-MVC

I'm getting myself acquainted with ASP.Net-MVC, and I was trying to accomplish some common tasks I've accomplished in the past with webforms and other functionality. On of the most common tasks I need to do is create SEO-friendly urls, which in the past has meant doing some url rewriting to build the querystring into the directory path. ...

ASP.NET MVC with jqGrid Form Editing - Controller Action for select options

Well, I'm falling for the jqGrid plugin for jQuery and trying to incorporate it in an ASP.NET MVC application. I have all the basic funcitonality working thanks to various blog posts from around the traps. What I am trying to workout now is how to return data from the Controller in such a fashion as to populate select options on the edi...

Trapping ValidateInput

If I have a search box on my page I clearly do not want the user to input any code that may be dangerous. However, I have a lot of data entry pages and each one needs to have ValidateInput(false) on the controllers. I don't want to allow dangerous input, but I also don't want to handle this in each and every controller. Is there a way...

jquery with asp.net mvc dialog box

i have a html link that i want to popup a dialog box with a list of user names and checkboxes. the user can then select one or more checkboxes and click OK and that information will be passed back to the main GUI. is this possible using jquery or should i be using another technology? ...

ASP.NET MVC ViewData.Model requires casting

I'm working on my first ASP.NET MVC application and have a strange issue. All the tutorials in regards to using strongly typed ViewData don't require casting/eval of ViewData / Model object but I get compilation errors if I don't cast to the ViewData object ViewData class: public class CategoryEditViewData { public Category categor...

ASP.NET MVC CookieTempDataProvider.DeserializeTempData returns null

I've been trying to use CookieTempDataProvider to pass a basic message between a post (entity update) and a get (entity list) using the RedirectToAction method. When using the default TempData implementation this works fine, however when I use the cookie-based version from the MVC Futures project, the TempData dictionary is empty after t...

Accessing objects created by ModelBinders in ActionFilters

I'm not sure if this is possible but I want to see objects created by my ModelBinders other than having them passed as parameters to my Action methods. I.e. I want to register a FooBinder and a BarBinder, then look at a Foo in the following method public void MyAction(Bar bar) or even ideally in an ActionFilter. Is this possible? ...

Does $.get() work to invoke actions when using ASP.NET MVC?

Does $.get() work if I'm working with ASP.NET MVC? If so, would someone please give me an example? I have written an aspx page that I wish to call using $.get(), in which I intend to call some function and send a response back to the page. If not, then would someone please point out an alternative? ...

Session Problem?

I have an MVC application that times out the session after 20 minutes. I store some values for a dropdown in a Session variable. If a user allows a page to timeout and then refreshes the page, I have no values in the dropdown. What is the best way to deal with this? ...

Different LoginUrl for different URL's with ASP.NET MVC and Forms Authentication

I have a ASP.NET MVC project, and I would like to have a different LoginUrl for different areas of the website. Depending on the area of the site, different types of credentials are entered. http://host.com/widget/home should redirect the user to http://host.com/widget/logon. http://host.com/admin/home should redirect the user to http...

Dynamic URL management with javascript

I have a search page which allows users to further filter thier results based on criteria within a certain set. You start a search by searching for all items within a "tag". The URL created for this would look like search/index?tag=TagA On the page there are a list of tags that are also in this result set. What I want is so in this...

ASP.Net MVC RedirectToSsl Issue

Hi, I am working on eCommerce app Using Asp.net 3.5 MVC. On my Cart View I have checkout button that redirect to Checkout action on the same controller: <%= Html.ActionLink("CheckOut", "CheckOut") %> My controller looks like this: [RequireSsl(Redirect=true)] public ActionResult CheckOut() { return View(); } ...

MVC using virtual path, routes are not working

I just moved my application under a virtual path on my local iis 7.0 so that I can host multiple sites.. Routes are not working part from the main page They seem to ignore the virtual path I created and going to the root - eg: instead of http://localhost/virtualpath/product/5 goes to http://localhost/product/5 I seem to be missing so...

accidental framebusting

I have an MVC web app where I'm redirecting in the Application_AuthenticateRequest in order to authenticate using this code: string[] tokens = Regex.Split(url, "(returnurl=.*default.aspx)"); Response.Redirect(url.Replace(tokens[1], "r=/")); It works fine on its own, but I need to host this app entirely within a...