Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Ajax controls do not appear to work

$
0
0

I have created a simple aspx page in VB with a dropdown list so that when an entry is selected from the list a label is populated with the selected value. I have added Ajax Controls to see the 'flicker-free' effect when the list item is selected. The code is as follows:-

        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:Label ID="Label1" runat="server" Text="Test Field"></asp:Label>
        <asp:TextBox ID="TextBox1" runat="server" Width="50px"></asp:TextBox>       
        <br />
        <asp:Label ID="Label2" runat="server" Text="Destinations"></asp:Label>
        <br />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:DropDownList ID="DropDownList1" runat="server" OnTextChanged="PopulateCity">
                    <asp:ListItem Selected="True">London</asp:ListItem>
                    <asp:ListItem>Edinburgh</asp:ListItem>
                    <asp:ListItem>Manchester</asp:ListItem>
                    <asp:ListItem>Birmingham</asp:ListItem>
                    <asp:ListItem>Sheffield</asp:ListItem>
                    <asp:ListItem>Glasgow</asp:ListItem>
                </asp:DropDownList>
            </ContentTemplate>
        </asp:UpdatePanel>

        <br />
        <asp:Label ID="lblSelectedCity" runat="server" Text="Selected City"></asp:Label>

The associated .vb file contains the instruction to populate the label as follows:-
    Public Sub PopulateCity()
        lblSelectedCity.Text = DropDownList1.SelectedValue
    End Sub
All very simple. I have run with and without autopostback on the dropdownlist but get the same result.using

I am using Visual Studio 2015 Enterprise running under Windows 10. Unfortunately, although the page compiles correctly it fails to load in IIS and fails with a Script error as follows:-
JavaScript critical error at line 1, column 1 in about:/WebResource.axd?d=pynGkmcFUV13He1Qd6_TZPtgUzshvNOrzBY02HNzwTWPgIUPSB8j6fqCs84jIC1ciFRWqTMUCIPk1rfsjGRGmw2&t=635817807509396181\n\nSCRIPT1002: Syntax error

The web.config file contains the basic entries as per a new website so I'm wondering if some entries relating to Ajax are missing or if the problem lies in the IIS configuration which I have never touched in the past 4 or 5 years I have been developing websites.

Any help would be appreciated, thank you.

Update

I have run the Microsoft Sample at https://msdn.microsoft.com/en-us/library/cc295469.aspx by copying the code into an aspx web form and have got exactly the same result which suggests a configuration problem. Again, any help would be appreciated. 

Further Update

I have loaded the copied code/aspx page to my personal website and it works! I think this narrows the problem down further - to ISS configuration on my PC. If anyone knows where I start looking again I would appreciate the help.


Viewing all articles
Browse latest Browse all 5678

Trending Articles