Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ToolkitScriptManager/ScriptManager and IsInAsyncPostBack 1

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
VB.net 2008. I have a master page with a ToolkitScriptManager I need for the Ajax controls. On one of the pages I want to use the IsInAsyncPostBack of the ScriptManager, When I add the ScriptManager to the page and run the page it says "Only one instance of a script manager can be added to the page". I understand this, but I don't see IsInAsyncPostBack as part of the ToolkitScriptManager. How do I do this?


Auguy
Sylvania/Toledo Ohio
 
After many hours I think I finally found the answer.

Code:
If AjaxControlToolkit.ToolkitScriptManager.GetCurrent(Page).IsInAsyncPostBack = True

Any feedback on this solution is welcome.

Auguy
Sylvania/Toledo Ohio
 
Ok, next problem. I'm having trouble defining and keeping the contents of a small datatable I'm building on the page. I have
Code:
Dim tblDrums as New System.Data.datatable
The page has a TabControl with two tabs. The first tab has an update panel with a listbox and several text boxes that are updated when I click an item in the listbox. The update panel UpdateMode is set to Always. The TabContiner AutoPostBack is set to False. I've tried various combinations of all of these settings and still am unable to create the table in the Page_load or elsewhere and have the table with it's data persist when I move from tab to tab. The only way I have gotten this to work is to re-create the table every time the Page_load is fired. There must be a way to do this, that is why I was investigating IsInAsyncPostBack in my original post.

Auguy
Sylvania/Toledo Ohio
 
I never use update panels, so I cannot help with those settings.
What I suggest is to create the table on page load and save it into viewstate so that is persists between postbacks.
 
Thanks, I've seen that suggestion in other places. Some say it will slow down the app, but I'm tempted to go that way because it's a small table with 40 rows and 10 columns.

Auguy
Sylvania/Toledo Ohio
 
There are no other options for what you want to do except to use viewstate or cache. Cache doesn't make sense if the data is going to change often. Using Viewstate or session is fine as long as it is not abused. Meaning, not using it for large amounts of data that isn't necessary.

The web world is stateless, which means you have to get the data on each hit of the page. So, you have no other options but to hit the DB each time. Or, to avoid that, use session, viewstate or cache.
 
Thanks, the table isn't very big and this page will not have a lot of users anyway.

Auguy
Sylvania/Toledo Ohio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top