views:

712

answers:

4

I Need a working example of a cascading drop down list box written in vb.net for my ASP.Net MVC application. I tried converting three examples written in C# but can't seem to figure it out and I have given up.

The examples I have tried to convert are found here and here.

This is my first .net application so I'm a newbie. The biggest problem I'm having is just don't understand the java script code in the views.

Thanks, John

A: 

The script is JQuery (not pure javascript.) There are a lot of good resources on JQuery around.

edit: Can someone add the "JQuery" tag so he can get better help?

Janie
+1  A: 

Is there something specific about the jQuery that you're having trouble with?

Why do you want to convert from C# to VB? You'll have a much easier time with the thousands of examples if you take the time to practice C# syntax. (The differences aren't that big at your level.)

EDIT:

The jQuery examples listed in the links you mentioned are pretty straightforward.

  1. Page contains a dropdown list of CarModels.
  2. Upon changing that dropdown, onChange event is handled via jQuery.
  3. jQuery uses its $.ajax method to post to another Controller method (i.e. /cars/colors/list?model=ValueOfCarModels.
  4. The controller method prepares a list of CarColors, and sends it back via a JsonResult that the $.ajax method consumes in it's callback function.
  5. The callback function populates then shows another dropdown by iterating over the array of CarColors.

Which step above isn't working?

Peter J
Ver 1 of my project is done except for this final piece so re-writing it would be out of the question. I feel comfortable using VB.Net so I should be able to write an application in that language. At the risk of getting into a language war, if "the differences aren't that big" then converting examples c# examples to vb also shouldn't be that big. I think my real problem is JQuery/JSON/AJAX/Javascript ignorance. thanks
John Marsing
A: 

The first link you have looks pretty nice.

Even if you dont know C# you could download the project and use Firebug to step into the Javascript.

There is so little code in the controller that I am pretty shure you can write it in VB once you debugged through the Javascript.

Malcolm Frexner
A: 

see my comments above

John Marsing