Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:823008
More Search Options
RSS Available
Matching Posts
Html.RadioButton throw exception during rendering after server validation
Let me first illustrate how the problem arises. Here it is an extract of the view: <%= Html.RadioButton("MembershipType", "0")%> Classic<br /> <%= Html.RadioButton("MembershipType", "1")%> Premier <%= Html.ValidationMessage("MembershipType", "*")%> Initially both radio buttons are cleared (i.e. no radio button selected). Upon submitting the form, the form contains no posted data for "MembershipType" which
Posted to
ASP.NET MVC
(Forum)
by
sia123
on 3/18/2009
Filed under: "ASP.NET MVC 1.0", "ASP.NET MVC"
Possible bug arrised from validating RadioButton without state that causes exception in MVC RC2
In the MVC RC2 source code file HtmlHelper.cs there is the following method definition: internal object GetModelStateValue(string key, Type destinationType) { ModelState modelState; if (ViewData.ModelState.TryGetValue(key, out modelState)) { return modelState.Value.ConvertTo(destinationType, null /* culture */); } return null; } In somes cases modelState.Value can be null in which case the above throws exception. It is null in the following scenario: I have the following in my view: <%= Html.RadioButton
Posted to
ASP.NET MVC
(Forum)
by
sia123
on 3/18/2009
Filed under: "ASP.NET MVC"
ASP.NET MVC RC 1 Source Code version
Does anyone know if the RC source code available at codeplex corresponds to ASP.NET MVC RC Refresh (as the post by Phil Haack ) or the original published ASP.NET MVC RC version? The AssemblyFileVersion on the source code is 1.0.40112.0 whereas the new refresh binary (DLL) version is 1.0.40128.0. Based on that, I assume that the source code refers to the old MVC RC version and not the refreshed version.
Posted to
ASP.NET MVC
(Forum)
by
sia123
on 2/1/2009
Filed under: "ASP.NET MVC"
Re: How to pass a value from View t to MasterPage
That it is strange check your web.config file to make sure you have the following declared: < pages > < namespaces > < add namespace = " System.Web.Mvc " /> < add namespace = " System.Web.Mvc.Html " /> </ namespaces > </ pages > If that doesn't work. I suggest create a new MVC Web App using the visual studio wizard. Then compare that created web.config file with yours. You'll see that the created master page file makes reference to ViewData
Posted to
ASP.NET MVC
(Forum)
by
sia123
on 11/27/2008
Re: How to pass a value from View t to MasterPage
I believe the MasterPage is rendered/loaded before your view, therefore if in your view you change/assign something to ViewData, the MasterPage won't see the change/added item as it is already rendered. You should set the viewdata in your controller action, this way your masterpage will be able to use it.
Posted to
ASP.NET MVC
(Forum)
by
sia123
on 11/26/2008
Re: MVC Beta - setting Properties on UserControls
Yes you can . Here is an example from parts of my application: Your view has to be strong typed, e.g. public partial class Personal : ViewPage < SkillsContentModel > Then inside that view you call render partial as e.g.: < div id ="SkillsContainer"> <% Html . RenderPartial ("SkillsContent"); %> </ div > Note that by not explicitely specifying any viewdata or model, you are passing the parent view model to the partial view user control. Your usercontrol
Posted to
ASP.NET MVC
(Forum)
by
sia123
on 11/11/2008
Re: Html.RadioButton sets all values to selected value after postback?
I wrote a full explanation of this bug and how you can overcome it until the next MVC release. Refer to this link: http://forums.asp.net/t/1338576.aspx
Posted to
ASP.NET MVC
(Forum)
by
sia123
on 11/10/2008
Re: using jquery error function
You cannot access the viewdata because that's on the server. JQuery is on the client side, so therefore you don't have access to viewdata or any server data. The ajax error function receives 3 parameters (the below is from JQuery documentation): error: function (XMLHttpRequest, textStatus, errorThrown) { // typically only one of textStatus or errorThrown // will have info this; // the options for this ajax request }
Posted to
ASP.NET MVC
(Forum)
by
sia123
on 11/9/2008
Re: using jquery error function
First of all your controller will need the [ HandleError ] attribute or you can add the attribute individually to each of your action methods. When an unhandled exception is thrown in your method (or methods that it calls). The controller causes Error.aspx page to display the error. Your method should look something like: public ActionResult MyMethod ( int rating ) { return Json ( new { Average = rating , Count = "119" }); } If you want to test your Jquery error handler, throw an exception
Posted to
ASP.NET MVC
(Forum)
by
sia123
on 11/6/2008
Re: Using the ViewData dictionary
The problem is that you must be storing the url in your ViewData.Model. The reason why <%= Html.TextBox("UrlName", ViewData["UrlName"]) %> works is because ViewData["UrlName"] is null and therefore MVC internally uses something similar to DataBinder.Eval(ViewData.Model, "UrlName") when the parameter is null. Therefore either in your controller store the Url directly in the viewdata, e.g.: ViewData["UrlName"] = "something"; Or use ViewData
Posted to
ASP.NET MVC
(Forum)
by
sia123
on 10/28/2008
Page 1 of 3 (22 items) 1
2
3
Next >
Channel 9:
Ping 42: Is Microsoft cool? Photo DNA, Win7 tool, 10k MIX contest
Channel 9:
Jafar Husain: Silverlight Toolkit and Rx, Part 1
Channel 9:
Francesco Logozzo - Static Checking with Code Contracts for .NET
Channel 9:
Channel 9 Live at PDC09: Doug McCuistion, NASA
TechNet Edge:
System Center Operations Manager 2007 R2 – Service Level Dashboard part 3: Configuration
Channel 9:
Reading Debate with Bill Buxton
Channel 10:
Reading Debate with Bill Buxton
WindowsClient:
Build WPF Data Controls for Outlook Addins Easily with VS2010
Channel 9:
Channel 9 Live at PDC09: .Net Rocks Part 2
Channel 9:
Channel 9 Live at PDC09: .Net Rocks Part 1
Channel 9:
Channel 9 Live at PDC09: Wei Zhu (Facebook)
WindowsClient:
WPF Manipulation Basics
ASP.NET:
High CPU in .NET app using a static Generic.Dictionary
TechNet Edge:
Deploying Silverlight - Why and How
WindowsClient:
Windows Client Developer Roundup for 12/21/2009
IIS.NET:
SiteShell
Silverlight:
4 Calendars & Plans for 2010 / 5770
ASP.NET:
ASP.NET MVC 2 and Visual Studio 2010
ASP.NET:
Moving your ASP.NET Application to Windows Azure – Part II
Silverlight:
HVP – Core Scaffolding and Updated News
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online