AjaxControlToolKit v16.1.0.0 TabContainer - asp.net

I upgraded to the latest version of AjaxControlToolKit and now none of my Ajax tab controls work. Previously they worked fine.
After the upgrade, my tab controls defaulted to invisible. I can force visibility with style="visibility:visible" in the tabContainer tag. Then it appears and looks ok, except that clicking on the tab headers does nothing. I tried setting them all with Enabled="True" with no effect.
<%# Page Language="vb" AutoEventWireup="false" CodeBehind="test1.aspx.vb" Inherits="Myapp.test1" %>
<%# Register TagPrefix="ajaxToolKit" Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="frmTest" runat="server">
<asp:ScriptManager ID="ScriptManager" runat="server"></asp:ScriptManager>
<br /><br /><br /><br />
<ajaxToolKit:TabContainer ID="hello" runat="server" OnClientActiveTabChanged="TabChanged()" ActiveTabIndex="0">
<ajaxToolKit:TabPanel><HeaderTemplate>First Tab</HeaderTemplate>
<ContentTemplate>Text on first tab.</ContentTemplate>
</ajaxToolKit:TabPanel>
<ajaxToolKit:TabPanel><HeaderTemplate>Second tab</HeaderTemplate>
<ContentTemplate>Can't get this tab to appear.</ContentTemplate>
</ajaxToolKit:TabPanel>
</ajaxToolKit:TabContainer>
</form>
</body>
</html>

I needed to removed OnClientActiveTabChanged and ActiveTabIndex and it worked correctly. The older version was not so fussy and did not mind me having OnClientActiveTabChanged pointing to a missing function.
It is worth noting that I barked up the wrong tree for a long time because the problem seems to occur with ANYTHING is wrong with either the TabContainer or TabPanel tag. In my initial test code to try to identify the issue I stripped out everything and got the same problem without either of these two tags. However it turned out to be a different reason (I omitted runat="server" in the TabPanels).

Related

JavaScript Error in Microsoft Edge with Telerik RadDatePicker in ASP.NET UpdatePanel

Telerik RadDatePicker inside ASP.NET UpdatePanel in Microsoft Edge browser throws JavaScript error when doing a post-back.
The error: "Unable to get property 'length' of undefined or null reference".
The RadDatePicker must be inside an UpdatePanel for the error to be thrown, and this ONLY happens in Microsoft Edge browser, all other browsers have no error.
Microsoft Edge version: 44.17763.1.0
Telerik Controls: Telerik.Web.UI, Version=2019.1.409.45
Any ideas how to fix this, or a work-around?
Here is my code:
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="EdgeDatePickerIssue.Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Default</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager" runat="server" ScriptMode="Release" />
<asp:UpdatePanel runat="server" ID="upPanel">
<ContentTemplate>
<label>Select Date:</label>
<telerik:RadDatePicker ID="dpStartDate" runat="server"
AutoPostBack="true"
OnSelectedDateChanged="dpStartDate_SelectedDateChanged" />
<telerik:RadButton ID="btnSave" runat="server"
Text="Save" OnClick="btnSave_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
Here is a screen-shot of the error:
Screen-shot Error in Edge
The problem is fixed in R2 2019.
Another way to solve it is setting the RadDatePicker's RenderMode property to Lightweight.
You could try to use Telerik RadScriptManager and Telerik RadAjaxPanel instead of using asp.net ScriptManager and UpdatePanel. Then, refer to this article to use DatePicker control.

AutoCompleteExtender Is not a known Element

Although, i write a code with all required lines in Asp.net , the Autocomplete extender not working ,i dont able to find the reason anyone can teach with code.
The Error i faced
Error 3 Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified.
Error 4 Unknown server tag 'asp:ScriptManager'.
Error 4 Element 'ScriptManager' is not a known element. This can occur if there is a compilation error in the Web site.
Error 5 Unknown server tag 'asp:AutoCompleteExtender'.
Error 5 Element 'AutoCompleteExtender' is not a known element. This can occur if there is a compilation error in the Web site.
<%# Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>AJAX AutoComplete</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:TextBox ID="txtCity" runat="server"></asp:TextBox>
<asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtCity"
MinimumPrefixLength="1" EnableCaching="true" CompletionSetCount="1" CompletionInterval="1000"
ServiceMethod="GetCity" >
</asp:AutoCompleteExtender>
</div>
</form>
</body>
</html>
AjaxControlToolkit i installed . and i want to excecute autocomplete textbox code
I think you have register you ajaxtoolkit as ajaxtoolkit tag on page so instead of using tag you should use tag. For example.
<AjaxControlToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtCity"
MinimumPrefixLength="1" EnableCaching="true" CompletionSetCount="1" CompletionInterval="1000"
ServiceMethod="GetCity" >
Yes its workin now !! becoz of the auto generated bin folder in Vs .. and also i changed the ajax toolkit version 1.0.20229 For Visual studio 2005...Thank you so much for every one .. your replies helped me lot..

AjaxFileUpload Doesn't Display Correctly or Function: Mysterious Black Button

I found AjaxFileUpload in the toolkit when searching for ways to upload multiple files.
I used NuGet to install.
Added <%# Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit"%> to the top of the page.
Ensured web.config has the reference:
<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
Where I presume the the upload button should be, I get a black box, when I run the page. The preview does show up correctly.
I did try it in a completely empty page (no master page or anything) and I get the same result.
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="School_Scheduler_2.Associates.test" %>
<%# Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<ajaxToolkit:AjaxFileUpload runAt="server" ID="multiUpload" />
</form>
</body>
</html>
Any suggestions?
Answer Since My Account Is Too Noob to the Post Answer Myself
This explains it: https://ajaxcontroltoolkit.codeplex.com/workitem/27493
Long story short: The Ajax Tool Kit does not like the vanilla ScriptManager. It insists on using their own ToolkitScriptManager.
This causes havoc with my MasterPages (I put the script manager on there to save me from adding it everywhere), but at least I know now and can start scheming possible solutions.
try this
<asp:ToolkitScriptManager ID="ScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div align="center">
<asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" AllowedFileTypes="jpg,jpeg,png,gif"
MaximumNumberOfFiles="10" OnUploadComplete="File_Upload"
Width="500px" />
Old question, but make sure to debug any javascript errors. Any errors will cause the described black button.
If you have any client side code that runs on OnClientUploadCompleteAll=, but fail to copy this code to a new page if you are copy/pasting the AjaxFileUpload control, you get a javascript error and it fails to render the control at this point, just leaving you with the black button.

asp net 4 - autopostback doesnt fire in ie6

OK, Im really stumped and hoping this is something simple. I have a form that relies on an autopostback of a radiobuttonlist to show or hide something. This was really elaborate at first and working fine, until I tested in IE6. The code below is as basic as I can get, all my code behind does is update the label to the radiobutton's selected value on click. This works in IE7 and 8, but not in IE6, what gives?
<%# Page Title="" Language="vb" AutoEventWireup="false" CodeBehind="testpostback.aspx.vb" Inherits="Checkout.testpostback" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:RadioButtonList ID="radio1" runat="server" AutoPostBack="true">
<asp:ListItem Text="Check1" Value="Check1" />
<asp:ListItem Text="Check2" Value="Check2" />
</asp:RadioButtonList>
<asp:Label ID="label1" runat="server" Text="none" />
</form>
</body>
</html>
Take a look at the generated javascript in your web page and probably it uses new features of javascript that couldn't be executed by IE6.
Chances are you can debug the javascript and see what happens.
Consider that IE6 in XP Sp3 is not the same as IE6 in earlier XPs and it has less problems.
This came up in this question as well. It seems to be an IE6 bug.

Events only firing on specific machines but not on others

I have been trying to solve this problem for several weeks now and it is getting really frustrating. Basically i have a simple project which includes one master page and one content page. the following code is what is found in the content page
<%# Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Button ID="Button1" runat="server" Text="ButtonContent"
onclick="Button1_Click" />
</asp:Content>
The button is bound to a simple event. A break point is set to detect whether the event fired as expected. The event does not fire when a form is placed above the content place holder.
<%# Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<form></form>
</div>
<div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
<div>
</div>
</form>
</body>
</html>
however the event is fired when the form is removed or place below the content place holder. On the other hand, on some machines i have found that it does not matter if a form is placed before the content place holder. I have tried this project on 4 machines (three windows 7 and one xp) it has worked regardless of form placement on two machines and has been subject to form placement on the other two.
Could some one please point me to some setting which could solve this problem or offer any advice to solve my problem. I need a form before the content place holder so removing is out of the question. It would also make sense that some sort of setting is preventing the project from working correctly on another machine
per HTML spec, you can not have form inside form. If I remember correctly some browsers break when you have this kind of structure. I think IE works fine.
If you need another form, put it outside of the <form id="form1" runat="server">
- above it, specifically. That is valid.

Resources