asp.net-mvc-2

passing FormCollection to controller via JQuery Post method and getting data back…

佐手、 提交于 2019-12-12 04:22:27
问题 I am having a slight issue sending formCollection data to my controller action method in MVC using jQuery .Post method. While I am sending the data via jQuery, it is not in the formCollection parameter of my action controller, well let me be more specific, it is in there, but not quite how I expected it to be in there... First off, the formCollection parameter now has 2 entries... the PopID passed in (21) plus the serialized data passed in (FirstName=Fifo&LastName=Caputo&DateOfBirth=

MVC .NET CSS not picked up by the View

陌路散爱 提交于 2019-12-12 04:13:12
问题 I am working on a MVC2 site and am having issues getting my objects on my views to inherit the css classes. Here is my helper object and CSS that is saved in the Site.css which is linked in the master page. This also works fine if I put the CSS in a tag on the masterpage. <%= Html.ListBox("ExpenseItems", (System.Web.Mvc.SelectList)ViewData["ExpenseDefinitions"], new { @class = "optionlist" })%> .optionlist { width:100px; height:100px; } Browser HTML: .. <link href="../Content/Site.css" rel=

Return ActionResult to a Dialog. ASP.NET MVC

青春壹個敷衍的年華 提交于 2019-12-12 03:52:50
问题 Given a method.. public ActionResult Method() { // program logic if(condition) { // external library // external library returns an ActionResult } return View(viewname); } I cannot control the return type or method of the external library. I want to catch its results and handle that in a dialog on the page - but I cannot figure out how to get back to the page to execute the jQuery that would be responsible for it. Any ideas? 回答1: You can call Method() by just routing your jQuery .ajax()

Unable to select the text left in the Iframe beyond the visible area

﹥>﹥吖頭↗ 提交于 2019-12-12 03:20:08
问题 I am using MVC3 and I have an Iframe in my page, and design mode for this Iframe is turned on for editing at run time. while running this in IE9, I am unable to select the text beyond the visible area of the Iframe. For example: if the first 7 lines are visible in my Iframe, then when I scroll to select the content in the 10th line, then the selection does not occur. <iframe id="RFrame" runat="server" style="width: 900px;"></iframe> <script type="text/javascript"> Sys.Application.add_load

Sorting Table by Its GroupName, Where Data is Fetched From Database using MVC 2.0

自闭症网瘾萝莉.ら 提交于 2019-12-12 02:54:38
问题 I need to have a View which looks something like this: [+] Group Name1 //this is supposed to be an accordion menu Sub Name| Scale1| Scale2| Scale3| Scale4 //this is supposed to be table header Abc | O | O | O | O // 'Abc' is text and ' O ' are radio button XYZ | O | O | O | O // Same as above row [+] Group Name2 Sub Name | Scale1 | Scale2 | Scale3 | Scale4 //Same as last table Pqr | O | O | O | O Mno | O | O | O | O I am able to get the table on click of [+]. And, I am generating the list of

Getting a MVC2 variable into Jquery

江枫思渺然 提交于 2019-12-12 02:47:48
问题 I am attempting to manipulate an asp.net MVC2 view variable in Jquery... (function () { debugger; var $a = 10; var $b = '<%:toggle %>'; var $c = 12; }); As you may have guessed, I am attempting to manipulate the toggle variable that I have initiated in an ASP.net MVC2 view in Jquery. What I did above doesn't seem to work at all. The page that I attempt to load, blows up every time I try and open it. Any ideas why that might be? Note... Even if I get rid of the ' ' (apostrophes) my page still

How to implement “no wait” controller call for an API?

旧街凉风 提交于 2019-12-12 02:14:39
问题 I have a set of MVC3 controller methods that i call from my JavaScript clients that do not require returning any data. It's purely one way push of tiny data-set for further processing. Each controller call can take anywhere from 100ms to 1000ms to queue up the transaction and no data/status will be returned back to the client. I just want the API call to return to the client right away while the processing happens in the background. Any pointers are appreciated. 回答1: public ActionResult

Updating a list of foreign keys in EF4, using MVC 2 Repository Viewmodel Pattern

喜夏-厌秋 提交于 2019-12-12 02:08:59
问题 Okay, I'm really struggling with how to update a list of foreign keys in MVC2/EF4. I have a one to many relationship between a Template object which can have many or no TemplateScenario objects. Essentially, I have an edit method in a controller that is trying to do this: // POST: /Modes/Edit/1 [HttpPost] public ActionResult Edit(int id, FormCollection formValues) { Template template = _templateRepository.GetTemplate(id); TemplateCreateViewModel viewModel = new TemplateCreateViewModel();

ASP.NET MVC 2 route errors - problems when using cottsak's solution

谁说我不能喝 提交于 2019-12-12 01:58:41
问题 I figured it'd be easier to ask here, where I can post some code, than in the comments of his solution. To see his solution, go here. EDIT: Some progress, but a new error. In my ErrorController class, I'm getting a NotImplementedException: public ActionResult InvokeHttp404(HttpContextBase httpContext) { IKernel kernal = new StandardKernel(); IController errorController = kernal.Get<ErrorController>(); var errorRoute = new RouteData(); errorRoute.Values.Add("controller", "Error"); errorRoute

MVC.NET in VB - Select List to Html.Dropdownlist

怎甘沉沦 提交于 2019-12-12 01:45:45
问题 Seems most of the examples I find are c#, so in some cases I'm left scratching my head... to make a long story short, I'm simply trying to output the selectList of items to a drop-down within my view: My ViewModel: Imports System.Web Imports Whitebox.UI Namespace ViewModels Public Class TFS_VModel Public Property AccType() As IEnumerable(Of LibAcctType) Get Return m_types End Get Set(ByVal value As IEnumerable(Of LibAcctType)) m_types = value End Set End Property Private m_types As