Wednesday, March 21, 2012

Atlas pulling back DataGrid

I'm pretty sure I can sell my boss on ASP 2.0 and ATLAS because of the non-post back. Pulling data from a DB.

Only, I don't know how to code Atlas to pull back say a datasource and put it into a datagrid without post back.

Any sample code anyon has done that they can share? I want to get something up quick, something small.

Click button and show data from a table.

I'm still reading through the tutorials.

I try the code at

http://atlas.asp.net/quickstart/atlas/doc/data/default.aspx#datatable
http://atlas.asp.net/quickstart/util/srcview.aspx?path=~/atlas/samples/data/datatable.src

Even their example comes up blank.

I copied the code and change the SQL connection and select statement, also changed the <label targetElements>'s to match table field names.

I get no data returned either like their example.

Secondly, how do you add a button to initate the data pull instead of just loading it.


I guess no takers. Or even point me in the right direction as in what to search on.

Mastro,

The Atlas UpdatePanel server control actually makes it super easy to turn any ASP.NET 2.0 GridView or other control into an AJAX-style UI with efficient postbacks.

If you have a GridView that is bound to a data source control, you can make it update without postbacks by doing the following:

1) Add an Atlas:ScriptManager control to the page, and setting the EnablePartialRendering property on it to true.

2) Enclose the GridView in an Atlas:UpdatePanel control, putting the GridView inside the UpdatePanel's ContentTemplate.

3) If you want to be able to add items, you can also add a DetailsView or FormView control to the page, and set up a trigger to update the GridView automatically.

Scott's weblog has a great post, with full sample code, that walks you through setting up a GridView bound to a datasource, and then enabling it for Atlas postbacks. You can find it athttp://weblogs.asp.net/scottgu/archive/2005/12/26/433997.aspx.

No comments:

Post a Comment