AutoCompleteExtender Is not a known Element - asp.net

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..

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.

AjaxControlToolKit v16.1.0.0 TabContainer

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).

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.

Webpage expired page displays on Uploading a file using ASP Fileupload control

I am using ASP:FileUpload Control for uploading the PDF files. I have limited the upload file size to 1MB in Web.Config like this.
<system.web>
<httpRuntime maxRequestLength="1024" executionTimeout="360"/>
</system.web>
ASPX code
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebpageUpload.WebForm1" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
Normal File Upload...
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Clear" OnClick="Button1_Click" />
</div>
</form>
</body>
</html>
Here the main issue is, When i upload a file more than 1 MB and click on Clear button, I am getting "Internet Explorel Cannot display this webpage."
Please find the Image for reference..
Thanks in advance...
When you set that value in web.config you tell IIS that you are going to be exceptioning on that condition. That means a YSOD. You need to either catch that exception and handle it gracefully or raise the limit and check it by hand. Unfortunately, with the file upload control, there is no way to check the file size ahead of time before the upload is initiated.
If you want to restrict the user to upload files to less than 1 MB, you have to put in the following condition and check the file size before uploading.
if (FileUpload2.FileContent.Length > 1048576)
{
//File Size is greater than 1 MB
}

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.

Resources