asp.net-mvc

How to retrieve checkboxlist values in the controller in asp.net mvc

I am having a form in a view page that looks as below: <form runat="server" id="dcrsubmit"> <asp:CheckBoxList ID="CheckBoxList1" runat="server"> <asp:ListItem>test1</asp:ListItem> <asp:ListItem>test2</asp:ListItem> <asp:ListItem>test3</asp:ListItem> <asp:ListItem>test4</asp:ListItem> <asp:ListItem>test5</asp:ListItem> <asp:ListItem>test...

radiobutton checked on condition in jquery

I have the following fields: <label>Company Type:</label> <label for="primary"><input onclick="javascript: $('#sec').hide('slow');$('#primary_company').find('option:first').attr('selected','selected');" type="radio" runat="server" name="companyType" id="primary" />Primary</label> <label for="secondary...

Flex and ASP.NET MVC tutorials needed

I am urgently looking for tutorials about integrating flex and asp.net mvc in an application via json. What I basically need is sending and getting data to/from the asp.net app and visualizing it using flex ...

Can you change a custom attribute from a controller in ASP.NET MVC?

I am looking to have an attribute "show" on certain properties in my class and give the user the option to show other properties in the view. Can I change a custom attribute from the front end? ...

Display success/failiure message in Jquery modal coming of a controller Viewdata.

Hello, I have a master detail screen In ASP.NET MVC, when I submit something, It instantly returns to me a grid with the inserted value via Ajax, my problem is: I want to pass a message of failiure or successful via an jquery modal dialog or infobar and I can't pass a viewdata for the jquery to process It. Any ideas? ...

Does jQuery have its own Ajax support?

I'm totally new to jQuery and Ajax, and I'm just confused trying to work out whether, if one is using jQuery, one needs the Microsoft Ajax stuff at all? I'm using ASP.NET MVC (and the last time I did web development it was all about posting the whole page back to the server). ...

ASP.NET MVC submitting json array to controller as regular post request (nonajax)

All the examples of json I can find online only show how to submit json arrays w/ the jquery command $.ajax(). I'm submitting some data from a custom user control as a json array. I was wondering if it's possible to submit a json array as a regular post request to the server (like a normal form) so the browser renders the page returned...

Best placement for javascript in Asp.net MVC app that heavily uses partial views

What is the best place for javascript that is specific to a partial view? For example, if I have a partial view (loaded via ajax call) with some divs and I want to turn those divs into an accordian, would it be better put the $("#section").accordion() in script tags inside of the partial view, or in a .js file in the function that retri...

overriding Method asp.net mvc

Hi Experts, Can I override an ActionResult method. Say I have a method Index in AccountController like this public ActionResult Index() { return View(); } Can I have one more method with same name but with differnt parameters like public ActionResult Index(int userid) { return View(); } I dont want to call it like http://something/...

Flex URLRequest and .NET authorization

can I make role based authorization when sending requests to an ASP.NET MVC backend system. I am calling action methods and expecting JSON results, however, some action methods are decorated with the [Authorize] attribute, others require some role privileges to be present. I certainly hope that passing authorization data with every reque...

Is Area what I am looking for?

Hi I'm new to MVC2 or MVC in general. I'm gone do basic app with a backend. Now I been thinking about how I should do with the folders, views, controllers & routes for the AdminFolder. Now I just saw something called Areas. Is that a way to go for me? http://haacked.com/archive/2009/07/31/single-project-areas.aspx ...

Differece between TempData and ViewData

What is major difference between TempData and ViewData? ...

asp.net mvc outputting json with backslashes ( escape) despite many attemps to filter

i have an asp.net controller that output Json as the results a section of it is here returnString += string.Format(@"{{""filename"":""{0}"",""line"":[", file.Filename); what i get returned is this: "{\"DPI\":\"66.8213457076566\",\"width\":\"563.341067\",\"editable\":\"True\",\"pricecat\":\"6\",\"numpages\":\"2\",\"height\":\"400\",...

Seriously, what's the deal with InheritInChildApplications? Does this work for anyone??

I've tried wrapping my <system.web> with <location path="." InheritInChildApplications="false"> like this <location path="." InheritInChildApplications="false"> <system.web>...</system.web> </location> But VS 2010 Web Developer Express keeps saying "The 'InheritInChildApplications' attribute is not allowed" and when I run my w...

ASP.NET Ajax.BeginForm Posts Even If Validation Fails

I'm just overlooking something simple... but my form, which is an Ajax form, always submits even if the validation fails. I'm not using jQuery validation, just the standard .NET MVC validation. Each of the field failing get show the validation message and highlight the field, but the form just submits anyway. Is there an OnBegin scr...

ASP.NET MVC 2 "value" in IsValid override in DataAnnotation attribute passed is null, when incorrect date is submitted.

Hello to all! This is my first question here on stack overflow. i need help on a problem i encountered during an ASP.NET MVC2 project i am currently working on. I should note that I'm relatively new to MVC design, so pls bear my ignorance. Here goes : I have a regular form on which various details about a person are shown. One of them is...

odd behavior when checking if radio button selected in jQuery

I had the following check in my jQuery which I thought was working fine to see if a radio button was checked. if ($("input[@name='companyType']:checked").attr('id') == "primary") { ... } Here's the radiobuttons: <p> <label>Company Type:</label> <label for="primary"><input onclick="javascript: $('#sec').hide('sl...

Configuring Multiple ASP.NET MVC Sites To Use a Single Database For Authentication/Membership

Is it possible for two or more ASP.NET MVC sites to use a single SQL Server database for authentication and other things? Here's how I'm thinking of setting it up: I will combine the current database of each site into one single database, prefixing the tables with the name of the site they belong to. I currently have authentication tabl...

Concurrent use of System.Net.Mail.SendAsync?

I want to use System.Net.Mail.SendAync in an ASP.NET MVC2 application. I see that it throws an InvalidOperationException if there is already a SendAsync call in progress. Does this mean only one SendAsync is allowed per host, or per thread? For example, if I simultaneously have 2 web users from 2 different remote hosts, can each use S...

Ambiguous call between methods ASP.NET MVC

I'm pretty new in ASP.NET MVC (about 3 months) and i've the followin issue: I have a Entity Class called 'Usuario' in a ClassLibrary referenced as 'Core' and, when i create a strongly-typed view and add a html.textboxfor<> like: <%= Html.TextBoxFor(u => u.Login) %> it raises the following error: Error 3 The call is ambiguous bet...