asp.net-mvc

Handle the button onclick event in masterpage in ASP.NET MVC

I am working with master page in ASP.NET (3.5) MVC Framework (1.0). I am having one master page and 4 MVC Views in my application. I have placed these four views in the contentplaceholder of the master page. I have a Previous Button, a Next Button and the Submit Button in the master page. Now the question is: How to navigate between th...

ASP.MVC antiforgery token and cryptographic errors

I'm using ELMAH to handle errors in my MVC sites and I've noticed over the past couple of weeks that I'm getting some CryptographicExceptions thrown. The message is: System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. System.Web.Mvc.HttpAntiForgeryException: A required anti-forgery t...

Is Using Db4o For Web Sites a judicious choice?

Is using Db4o as a backend datastore for a Web site (ASP.NET MVC) a judicious choice as an alternative to MS SQL Server ? ...

Return JsonResult using an ActionFilter on an ActionResult in a controller

I want to return the Model (data) of a controller in different formats (JavaScript/XML/JSON/HTML) using ActionFilter's. Here's where I'm at so far: The ActionFilter: public class ResultFormatAttribute : ActionFilterAttribute, IResultFilter { void IResultFilter.OnResultExecuting(ResultExecutingContext context) { var view...

ASP.NET MVC ModelMetaData: Is there a way to set IsRequired based on the RequiredAttribute?

Brad Wilson posted a great blog series on ASP.NET MVC's new ModelMetaData: http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-2-modelmetadata.html In it, he describes how the ModelMetaData class is now exposed in the Views and templated helpers. What I'd like to do is display an asterisk beside a form field label if...

create controller base class(partial)

ok here goes, since my html.renderaction crashes my dev and prod servers i have to use partials(crap) i tried creating public partial controller{} class so i can set needed data for all my views but i am having no luck (everything breaks) i am coming from LAMP cakePHP background and really need simplicity. i need to know how to create...

How to change mvc dynamic pages route url - Why does this not work?

For the controller below, why does a call to http://localhost%3Aport/content/about not pass "about" as the value for the page parameter of the index controller? Default routing. Clearly I do not understand routing... public class ContentController : Controller { private IContentService _service; public ContentC...

Best way to get server values into JavaScript in .NET MVC?

Using ASP.NET MVC + jQuery: I need to use some values owned by the server in my client-side JavaScript. Right now, I've temporarily got a script tag in the actual view like this: <script> var savePath = '<%= Url.Action("Save") %>'; </script> But I want to move it into something cleaner and more maintainable. I'm thinking of somethin...

Session Fixation in ASP.Net MVC

Is it possible to block an action to be executed directly from the browser, but still be able to redirect to it from inside the site? I know it sounds stupid but this is what I want: Lets say there are two routes, Index and Index2 of HomeController. www.website.com/home will cause Index to be executed, I then want to execute some code...

How to Persist a DataSet to The Database when the Server is Rebooted

I have a dataset in cache and I don't want to lose the information in the cache even if the server is rebooted. Is there a way to do this? ...

Paging search results with asp.net MVC

I have a situation that I couldn't find a solution for through my searches on here. Here is the scenario: I have a search form with 2 required fields and multiple optional ones. The form posts to an action method that determines which fields are selected and builds a List<> of objects that match the search criteria. I then pass that Lis...

ASP.NET MVC FormsAuthentication Cookie timeout cannot be increased

Using the default ASP.NET MVC template, I cannot figure out how to increase the FormsAuthentication timeout. It seems to always use 30 minutes. I have followed Scott Gu's recommendation from this blog post, but it does not seem to make a difference. Does anyone have a suggestion? His suggestion was to set the timeout value in the web...

ASP.NET MVC2 missing Microsoft.Web.Mvc.Controls

I've seen quite a few references to the Microsoft.Web.Mvc.Controls namespace in MVC examples, but I don't have that assembly or namespace available. I'm using ASP.NET MVC2 Preview 2. Anyone know where I should be looking? ...

Force a complete match on all tokens of a MapRoute against URL string

Is there any way to force a Route to be executed, only if all tokens are present in the URL string? Consider this Route: RouteTable.Routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Test", action = "Index", id = 0 } ); This Route execute on /Home/Index/1 and /Hom...

problem with jquery dialog

I have a partial view with a dropdown (with Paid and unpaid as options) and a button. I am loading this partial view using jquery load, when the user click Paid/Unpaid List link in the sub menu of a page. When i select Paid in dropdown and click the button, it shows the list of paid customers in the jquery dialog and if i select Unpaid...

Facebooks Big Table Implementation

I found out that facebook use whats called a big table. Is there a way that I can use this "Big table" database in an application that I am using? ...

How to prevent dirty write for web forums?

Hi all, As a apprentice for web development, I have no clue of preventing dirty write for web forums. Is there any food for thought? Thanks in advance! I'm working on ASP.NET MVC and Entity Framework. Okay, sorry for misleading. The dirty write here means overwrite changes of another person in the database. While using a Optimistic Co...

Any experience combining JS / CSS in MVC?

I'm planning to implement a solution for combining multiple js/css files into single files in my MVC project, but currently I doubt between the following two possibilities: Telerik Extensions for ASP.NET MVC (www.telerik.com/products/aspnet-mvc.aspx) Supports combining multiple files into one request Supports groups of web assets Sup...

ASP.NET MVC permitting only one logged in user

Hello, I have an experience with CakePHP and now started coding on ASP.NET MVC framework. I have a problem with the login system. How can I restrict users from logging only one time simultaneously on my system? I can create a field in my DB where Customer becomes active when logs in. If he logs out I can make active false. But what if ...

HttpHandlers with ASP.NET MVC

If I have a standard AXD HttpHandler and the default ignore route for *.axd, then why is ASP.NET MVC still handling requests in subdirs, for instance if there is a request made for /Content/Css/css.axd?d.... If the request is made at root /css.axd?d.... everything works fine. ...