- Download latest version of Jquery from Jquery.com or you can use Google API link which will be more reliable.
Lets add a aspx page in our Asp.net web project named jqAirlines.aspx
and add the javaScript link to jquery and format your aspx page. I have done mine as below:
Now lets analyse this code:
I have div id="pageBody" that lies inside the form. and I have 3 more divs namely "dvLoading" where loading image is displayed, "tableArea" where main grid loads but this table has structure only and finally "btnArea" where my buttons will be located, now i only have Display button.
Now we are done with our aspx page now we need main files where we do our code rendering. Lets add a javacript file called jqAirlines.js , You might have noticed link to jqAirlines.js in the aspx page. Here we write all our JQuery code from where we will render the aspx page.
Lets see the JQuery code from the link provided below and i will try to explain how this javascript functions:
then hide and empty the table if it is already filled. Then Append the header row in #airTable thead .
Now from the data we loop through a collection inside it called Data that has been returned by jqAirlines.ashx page and append the data to tbody other seem pretty straight forward where page items are shown or hidden.
Now We have completed our .js file as well but the main portion where it calls the business layer function and converts back to json object and returns back for this .js to render is handler jqAirlines.ashx Further explanation of this handler is done in How to use Json objects and Jqeury in Asp.net? Part 3 of this Tutorial.
Now We have completed our .js file as well but the main portion where it calls the business layer function and converts back to json object and returns back for this .js to render is handler jqAirlines.ashx Further explanation of this handler is done in How to use Json objects and Jqeury in Asp.net? Part 3 of this Tutorial.
No comments:
Post a Comment