I have an ASP.NET MVC app that opens a "Request" view in a new browser window. When the user submits the form, I'd like the window to close. What should my RequestController code look like to close the window after saving the request information? I'm not sure what the controller action should be returning.
...
I'm running into an issue with the bind attribute in asp.net mvc. I have a custom ViewModel that looks like this:
public interface IUserView<TUser> where TUser : User
{
TUser User { get; set; }
string Email { get; set; }
string ConfirmEmail { get; set; }
string Password { get; set; }
string ConfirmPassword { get; se...
I'm having a little problem with this setup here I have a list of .ascx files and they all do different tasks in terms of calculations to the controller itself. So on my .aspx page I click on an Ajax.ActionLink() and this will render that specific .ascx file based on the item I clicked. Within that .ascx are 1-3 events that will fire 2 o...
Is it possible to return a complex type from a controller to a view in asp.net mvc? All the examples I have looked at so far demonstrate passing simple intrinsic types like int, string....
...
Hi,
I have a page with two input fields City and Venue. I have the autocomplete plugin from Devbridge working great for the city field. I now want to get it working on the venue field. The javascript I have so far is:
<script type="text/javascript">
$(document).ready(function() {
$('#Event_City').autocomplete({
...
This should be simple, but the answer is eluding me. If I've got a Save action in my controller, and the save fails, how do I cancel the action without disturbing what the user entered? For example, Index is strongly-typed of "MyTable":
Function Index() As ActionResult
ViewData("message") = "Hello"
Return View(New MyTable)
End F...
In addition to being a 30 year pattern, MVC was never meant for current applications. MVP was its successor and designed to handle event based apps coming out in the 90s. Passive View and Supervising Controller seem to have risen to the top. For those two, it almost isn't necessary to talk about MVC/MVP.
Specifically, is the controll...
I am trying to implement Optimistic Locking in an asp.net MVC application, as well as provide audit trailing.
The audit framework relies on being able to call DataContext.GetModifiedMembers during SubmitChanges, which makes good sense, i guess.
The optimistic locking uses ROWVERSION timestamps, serialized to base64 and put in a hidden ...
I have a controller with that I want to pass off some data to a view.
The view is strongly typed like:
System.Web.Mvc.ViewPage<SomeObject>
Now when I call the following in the controller:
return View("SomeAction", someObject);
I want it to enforce that I need to pass in 'someObject'.
Eg. I want the following to fail and not compi...
Why am I getting a exception when ApplyPropertyChanges???
The code is almost the same when I'm editing a user table but is not working with my news table.
The create, delete and details are all working fine but when I try to edit a news I'm getting the exception below:
The ObjectStateManager does not contain a ObjectStateEntry 'MagixC...
I have a JQuery confirmation popup, with Yes, No buttons. The Yes button calls this function:
function doStuff() {
$('#confirmPopup').dialog("close");
var someKey = $("#someKey")[0].value;
$.post("/MYController/MyAction", { someKey : someKey },
function(responseText, textStatus, XMLHttpR...
I have following code which only works for first time page is hit. <%= Html.TextBox("Amount",Model.Amount)%>
In above line, debugger shows property calls to get Model.Amount each time the view is being generated. But updated value of Amount is not reflected in generated HTML.
Help
...
I have an MVC application view that is generating quite a large HTML table of values (>20MB).
I am compressing the view in the controller using a compression filter
internal class CompressFilter : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
HttpRequestBase ...
I am using the Html.TextBox helper method to generate a textbox against my model but when i pass in an anonymous htmlAttributes class with @class defined like below, the class is never assigned. Am I doing something wrong? I have assigned a readonly attribute the same way and it worked.
<%= Html.TextBox("LastName", Model.LastName, new...
I am having trouble with forms authentication. The root web.config is setup to deny access to all non authenticated users with a structure like:
Controllers
Folder - Webforms
Folder1 - Webforms
Model
Public Folder - Webforms with web.config to allow public access
Views
web.config with deny
I need to have the home controller public as...
I plan on building a simple, yet high usage webapp and need to settle on an architecture.
basic server side logic / dynamic db
driven content about half a dozen to
a dozen pages serving up all said
content
no need for URL rewriting,
pretty simple page flow/routing
The objective is to publish this app to use the least amount of band...
While rendering the view page, based on some condition in the controller action I want to disable all the controls (textbox, checkbox, button etc) present in the form in a MVC view page. Is there any way to do that? Please help.
...
Another repository of App_Code? Inside the NerdDinner sample, it contains some share interface, function , class with property etc. Not much different with App_Code.
...
I want to access a Session value in jquery method in the ASP.NET MVC view page. See the below code,
$('input[type=text],select,input[type=checkbox],input[type=radio]').attr('disabled', '<%= Session["CoBrowse"].ToString() %>');
Please advice how can I get the Session value in jquery.
...
(Hope this doesn't get duplicated; second attempt at submitting this question)
I'm working on a form in which I'd like to give the user the ability to add an undetermined number of Contacts (Name and Phone Number). I only want to show one row of these form fields to start with, and allow the user to click an element which will add dupl...