yad4u jQuery + ASP.net MVC

jQuery + ASP.net MVC

Here is the problem. lets say I have a product category table and a product table. by using foreach statement getting categories making them a html table and putting products inside the table as a radio group. so 3 product categories makes three different html table and inside the tablo i m listing the product as radio buttons.

when user selects an product i'm using jquery post statement and send some data. I'm using below jquery to understand which radio button selected.

$(document).ready(function () {     $("input[name='AD']:radio").change(function () {         var data = $("input[name='AD']:checked").val();         $.post("/Configure/UpdateAd/", { id: $(this).val() }, function (data) {             update($("#bottomRightA"), data);         });     }); }); 

And it works! but

here I have a problem.


I m using this way to differentiate radio groups based on category.

input type="radio" name="<%: model.CategoryName%> value="<%:model.CategoryId%>" 

if I make all radio buttons name 'up', they become the same group as expected. and I cant tell the jquery which radio group is selected. Is there a way to use jquery with some kind of mvc nuggets?. Like below

input[name='" + <%: model.CategoryName + "'] 

or anything I can do with jQuery?

Write css for individual page in mvc3 project


Asp.net WebForms app that runs MVC in a subfolder
If I understand you right, you want to hook up all radio buttons, but treat the categories separately..
how do i have a facebook-like scrolling updates on my website showing all activity
You can pick up the name of the changed radio button and use that in the code:.
Razor view engine - How can I add Partial Views
$(function () {   $("input:radio").change(function () {     var name = $(this).attr("name");     var data = $("input[name='"+name+"']:checked").val();     $.post("/Configure/Update"+name+"/", { id: data }, function (data) {       update($("#bottomRightA"), data);     });   }); }); 

MVC2 client/server validation of DateTime/Date using DataAnnotations

94 out of 100 based on 44 user ratings 1144 reviews