Hi
I am new to ASP.NET, AJAX, JSON, jQuery and am trying to figure out a solution to the following problem:
There is this web page in ASP.NET which would contain few radio buttons. The page_load() would query SQL Server database and get a list of years i.e. 2009, 2008, 2007, 2006 etc. In the client side script, I need to create as many radio buttons as the number of years returned. For e.g. if the query returns 2009, 2008, 2007, 2006, then the page should show 4 radio buttons. I have an upper bound on the number of years which can be returned, so I intend to create that many radio buttons and do a show/hide based on the number of years returned.
What I have done so far?
- In the Page_Load(), I queried the table to fetch the list of years into an arraylist.
- Serialized the arraylist using JavaScriptSerializer.
Questions:
- I know I need to deserialize the server side object. But how do I access it in using jQuery?
- Am I taking the correct approach to solve the problem?
Pardon me in case my questions and approach is naive. Do guide me on this.
cheers