Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Unassigned: AjaxControlToolkit TabContainer Error when programatically changing tabs [28038]

$
0
0
I'm using the latest version of the Ajax Control Toolkit v15.1.4.0 (Dec 2015)

In our website we have a form where depending upon the value of an item in the querystring we will take the user to a different tab. This code is in page_load of the code behind file. The code is as follows:

```
tabsHLAAntibodiesResultPage.ActiveTab = tabsHLAAntibodiesResultPage.Tabs[2];
hfCurrentTab.Value = "2";
```
This code works correctly and the user is placed on the appropriate tab.

We wanted to introduce a new feature on a different form which would entail the user being taken to a test results form and then being returned to the list of tests undertaken. To put the user back on the tests undertaken tab entails us having to change the tab that the user would normally have landed on when the form is loaded.

So, using the same logic as before we added the following code to the page_load of the form we want the user to return to:-
```
if (Request.Params["From"] != null && Request.Params["From"] == "TestResultPage")
{
tabsPatientDetailsPage.ActiveTab = tabsPatientDetailsPage.Tabs[4];
hfCurrentTab.Value = "4";
}
```

When the user returns to the form from the test result page we're getting the error that can be seen in the accompanying attachment.

Looking at the scriptresource.axd file the error is occurring in the following block (specifically it is the ._validateParams function) :-

```
var $addHandler = Sys.UI.DomEvent.addHandler = function Sys$UI$DomEvent$addHandler(element, eventName, handler, autoRemove) {
/// <summary locid="M:J#Sys.UI.DomEvent.addHandler" />
/// <param name="element"></param>
/// <param name="eventName" type="String"></param>
/// <param name="handler" type="Function"></param>
/// <param name="autoRemove" type="Boolean" optional="true"></param>
var e = Function._validateParams(arguments, [
{name: "element"},
{name: "eventName", type: String},
{name: "handler", type: Function},
{name: "autoRemove", type: Boolean, optional: true}
]);
if (e) throw e;
```

If the code block based on Request.Params["From"] (as given above) is commented out the form loads successfully on the 1st tab but we want it to load on the 5th!

I scoured through the code of the two forms (that use this technique to change the active tab programmatically) but cannot see anything else that could be preventing the tab change being made successfully in our new code.

Can anyone shed any light on where the problem might be?
Comments: I've found a workaround using javascript. I can't provide a sample project at this time as it would entail too much work. It wouldn't be as simple as taking the offending form and putting it in a project of it's own as there are too many dependencies involved.

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>