Where is the <%=Html.RadioButtonList()%> extension in MVC beta? - asp.net

Is there any reason why there isnt a radiobutton list helper in the core MVC beta? There's a dropdownlist, but no radiobuttonlist.
I know that I can easily create an extension method to do surely this is a core thing?

its in the mvc futures you can dowload on codeplex. but i believe it has bugs.

I think it was removed for the sake of simplification, instead you can just use a foreach loop.

Related

So does it mean RAZOR without MVC cannot even do the event handler stuff?

I am new to RAZOR and now I need to trigger an event when users clicked a button, so I can run a lines of code to handle the event.
I don't want to use it with MVC, and I don't want to use JavaScript because I only want to explore the power of RAZOR.
I was surprised when someone told me that the way of event-drive methods has been discarded in the RAZOR, that's alright. But my question is
what is the way to handle/response a click event (in the RAZOR syntax) which is the simplest thing in the ASP.NET Web Form applications?
The reason why I'm asking this question is I found that even the easiest thing like I want to write a fragment of code to response users' input hard to be done(or should I say there is no way to do it) in the RAZOR.
You can take a look the discussion in my previous post.
ASP.NET RAZOR cannot capture the event
I hope there are some guys who can guide me through the first and tough step.
Thanks.
Update:
It seems that there is really no way to handle the user events in any way without the help of MVC framework. Thank you guys for your answers. I'd like to leave this post a few days longer and hopefully I could see someone post something interesting.
Thank you again.
There is no such thing like a click event in Razor.
Event handling is a concept that was used in WinForms. The event model in classic ASP.NET WebForms was an effort to translate the Windows programming model to the web, which, frankly, didn't work very well. A stateful event model and web programming pretty much contradict each other.
If you want to work with events then use classic ASP.NET WebForms. If you want to embrace the web and not work against it, learn ASP.NET MVC, Razor, etc.
Don't try to fit a stateful legacy paradigm on a stateless infrastructure. This is what Microsoft did with WebForms and that is where it should stay.
Razor is only for use with ASP.NET MVC. You can't use it with the WebForms model, though there are some advanced and messy scenarios where some folks mix the two. This isn't what you want.

ASPX VS CSHTML to do grid processing

I need to write a web page which I need to interact with Grid entry/edit.
I choose ASP.Net MVC and LINQ TO Entity Framework.
What my problem is I have two option to choose at View Layer.
ASPX
Razor CSHTML
Could someone please give me suggestion which one is more suitable to interact Grid Entry Edit process? And Why?
If there are any references , please let me see them also.
[UPDATED]
JQUERY Grid
Telerik Grid for ASP.NET MVC
Razor Web Grid
After I searching through at Google, I get more than one Grid Controls.
I still wondering which one I need to use.
When I was writing with net 2.0 framework, I use template control from GridView Control in traditional way to put Combo or some other controls to attatch with GridView.It is really useful.
So What i thinking is, at asp net MVC 3 version, should i also use these traditional technique as well.
Could anyone please give me suggestion?
Razor is simply more concise. Both Razor and WebForms will offer the same basic functionality, but Razor results in Views that are much less cluttered and therefore more easily understood.
View engines have nothing to do with this. They both provide the same functionality, which you use is up to you and your preference.
There are many kinds of grids available for MVC, but MVC itself does not come with a grid. You either have to build the grid yourself, or use a third party component, most of which are jQuery based. Again, it's up to you what to use, as it's your preference.
All you can do is choose something and go with it. If it doesn't work for you, choose something else. MVC is a technology that requires you to know much more about how the framework works. If you want point and click and drag and drop, you should go back to Web Forms.
.chtm provides "Mapping of Data(or Business) objects that Your UI needs to Render(the html)" in a isolated way, so you can control the Test Cases for your UI as well as your Business Object Unit testing, which is Hard using ASPX since you have to create HTTPContext and (SSL and all crap) just to TEST your Business Logic..in short .cshmt is more NEATLY TESTABLE than aspx.

Fill controll type Menu using ASP.Net MVC

is there any way to fill a controll type System.Web.UI.WebControls.Menu with data from database if i use ASP.Net MVC?
If yes how can i do this?
Fill? Probably.
Use effectively? Probably not.
WebForm controls are built around the page lifecycle and viewstate. MVC has neither of those.
You could accomplish something similar by using a Partial View for your menu and create a ViewModel to populate it - just populate the ViewModel with your data from the DB. But otherwise Jfar is correct.
I'll get some links if I can - currently on my phone. Hope this helps some.

ASP.NET: Populate a class from form postback?

I was wondering if there is a tool / framework or something similar that would allow me to populate a class' properties with the items from the FORM posted values?
Rather than doing
class.ID = Response.Form["ID"];
etc
I currently use automapper for tranforming from some objects to another..
Maybe its possible to do this?
Any ideas?
EDIT
To confirm the technology is winform (ASP.NET) not MVC.
In MVC this is built in. Put in a class in your Controllers Action parameters and it will be implicit.
Guess you might be using .NET forms though?

What is the best solution for displaying data in ASP.NET MVC?

I am new to ASP.NET MVC and I want to know your opinion about what is the best way to display some data from database using a <table>... an ASP.NET control or a jqGrid?
In which situation must each of them be used?
I appreciate any tips. Thanks.
If I understand correctly, the MVC model doesn't support the server-side event handling of standard asp.net controls, so I'd say that the jquery grid is definitely the best option.
Asp.net controls cannot be used in asp.net mvc.
The best way is to create a ViewModel classes and declare View as strongly typed.
I could continue but unfortunately don't know what exactly do you need.
Do you mean ASP.NET Controls or ASP.NET MVC Controls?
ASP.NET Server Controls should not be used in this framework... or rather, you should not use anything that relies on postbacks and/or viewstate. There are tricks to get some to work, but YMMV.
If the control is an ASP.NET MVC Control, that's a different story, and it will work ok.
JQuery controls also work since they are javascript controls.
use the MvcContrib grid. it is working fine

Resources