One of the featured of FBML and FBJS is the ability to display standard dialogs (see above: Using FBJS Dialogs). We can use one of standard dialogs to display dynamic content, for example, the list of records from the SQL Server database:
To do this, first of all I needed to add a link to the main GridView (see above: Using with FBML).
So, when the user clicks on the "show...history" link in the main Grid, the application shows records from the database. In order to get anything back from the database or from the server-side, the application needs to "post-back." Fortunately, FBJS has built-in support for AJAX (see more at Mock AJAX). So, we can post-back to the server and patiently wait for a reply:
]]>
...where object_action_history.aspx is the ASP.NET page:
Basically, object_action_history.aspx, when it returns from ajax.post() to ajax.ondone(), gives nothing more than just a "rendered" GridView. Then, in JavaScript (FBJS) on ajax.ondone, we take that data and "shovel" it down Dialog.showMessage():
]]>
Thats it for this post, hopefully it will help you guys.