asp.net-mvc

Events in Asp.Net MVC

Hi, Are the controller actions an analogous feature to the ASP.NET events? and How to Handle postback in Asp.Net MVC as there is no viewstate and postbacks in MVC what is the alternative for that in the framework? ...

Asp.net MVC with SQL Server stored Procedure

I am an asp.net webforms developer and new to asp.net MVC.... Is it possible to use SQL Server 2005 stored procedures in asp.net MVC?? If so can any one help me.... ...

ASP.MVC ModelBinding Behaviour

This one has me stumped, despite the numerous posts on here. The scenario is a basic MVC(2) web application with simple CRUD operations. Whenever the edit form is submitted and the UpdateModel() called, an exception is thrown: System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException was unhandled by user code This occurs again...

Html.RenderAction performance?

I could like to have multiple Renderaction on my view, but one thing considering is that the perfomance of renderAction in this case. For example, i have several modules and i could like to render it on the view, there are 2 ways to do it: Query in controller, which is long to call, we can do async here In the view, call RenderAction...

Render a view for an email in Asp.Net MVC 2 in a background service

I need to render a view to send as an email using Asp.Net MVC 2. Using the new Html.Partial method it is easy to render a view to a string and then send it as an email as long as you do it from inside a controller or a view (where you can access the html helper or the controller context) I need to be able to send a delayed email using ...

Parameter ok in RouteData but passed as null in controller

I'm a few weeks into MVC now, and each day, something new pops up which strikes me as quite odd. So, I try to find answers to the issues I'm facing. None the less, for the current issue, I can't seem to find a descent answer here on stackoverflow, or anywhere on google for that matter... I'm having an issue passing parameters to my cont...

ASP.NET MVC and passing ID to strongly typed BeginForm

Hello, I have some problems on passing an id from URL into my controller action Lets say I have this Url : Bing/Index/4 In my master page I would like to generate a form that submits to BingController SearchAction. I did something like this using(Html.BeginForm<BingController>(action => action.Search(id))) How to get id (4 in this e...

Help with asp.net mvc select dropdown

I have a marital status field in my users table that its just varchar yet I only want to give the users four options (married, single, widowed and divorced) and i want to have the correct one selected when Im editing the form.. is it possible? please help. ...

How to apply Sql Dependency in ASP.NET MVC?

How can we apply Sql Dependency in Asp.Net MVC for cached objects? ...

ASP.NET MVC Postback on Modal Dialog/ Popup

Hi all, I have a link on an asp.net mvc view which opens a modal popup in which a second MVC view is rendered. The view in the Modal popup exposes several features which trigger a postback. The postbacks fire the correct controller methods but when i return the updated view the View itself is render as opposed to being rendered in the ...

Help with c# and bool on asp.net mvc

Whats the best way to print out "Yes" or "No" depending on a value In my view I want to print out Model.isStudent and I dont want True or False, I want Yes or No.... do I Have to write if else statement? ...

why Can't I save page from my ASP.net MVC website

hello there! i've builded an asp.net mvc website,when i click the "file->save page as" button in my browser and try to save the page as a local html file,there is no response and saving failed.why is this happening? ...

Jquery Calendar on Partial Page problem

I have a partial page with a jquery calendar on my form. When the partial page loads the calendar button does not show. I am using Ajax.BeginForm and UpdateTargetId to load the partial page. I think the Jquery does not initialize on a partial page. Anyone know what is going on? ...

Datagrid choices in ASP.NET MVC

Possible Duplicate: grid controls for ASP.NET MVC ? Hi, I just started using asp.net MVC and I'm looking for any good Grid Html helpers or libraries to use with it similar to Web forms datagrid control, I have just used MVC contrib grid so far. Thanks. ...

ASP.NET MVC 2 | Load Area at Runtime

I'm trying to figure out the best way (or if it is possible) to decide if an Area should be loaded based on some runtime parameter. I only want certain Areas available in certain situations. Is there a "best practices" around this. A better way to ask this question may be, can you register the routes of an area at Runtime or Session_St...

Transaction Filter Exception handling ASP.NET MVC

I am using S#arp Architecture on a project, which comes with the [Transaction] attribute for Controller methods. With this, the Transaction Commit is called as a OnActionExecuted filter, meaning it occurs after exiting the Controller method scope. My issue with this is what happens when an exception occurs during the commit? From the ...

Best method to creating re-usable sections in asp.net-mvc

I have a form that I need in various parts of my website. User's enter their address, and submit a form that saves the address. I want to wrap this up so I can re-use it since I need this exact same functionaility in a few places. I am thinking to do this: create a partial view with the form, but have the action location url passed i...

pass an object to a user controls ViewModel in asp.net mvc

I have a View that uses a specific ViewModel. The viewModel has various object e.g. Foo, Bar...etc I have a user control that has its own ViewModel which contains a Foo object. How do pass the Foo object from the page View to the usercontrols ViewModel? ...

Response.Flush breaking Page Caching

I have some code that is used to replace certain page output with other text. The way I accomplish this is by setting the Response.Filter to a Stream, Flushing the Response, and then reading that Stream back into a string. From there I can manipulate the string and output the resulting code. You can see the basic code for this over at...

Textarea from tiny_mce on page ascx MVC AJAX

What is need to do that Textarea from tiny_mce has worked on page ascx. That work on page aspx in MVC. Page ascx is <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CreateArticle.ascx.cs" <script type="text/javascript" src='<%= Url.Content("~/Scripts/tiny_mce_src.js") % >'></script> <%using (Ajax.BeginForm("CreateArticle","...