AjaxCombobox

Below is vb.net code behind and asp.net mark up for an ajax combobox.  I cannot get it to work.  I keep getting an error - javascript runtime error: 'MaxPntBtn_Click' is undefined.

Can anyone help with this?
Thanks in advance for the help.
Protected Sub MaxPntBtn_Click() Handles MaxPntBtn.Click
  Call MetricDrpDn_SelectedIndexChanged()
End Sub

Protected Sub MaxPntsDrpDn_TextChanged() Handles MaxPntsDrpDn.TextChanged
  Call MetricDrpDn_SelectedIndexChanged()
End Sub

<asp:TableCell ID="TableCell52" runat="server" ForeColor="#FFFFCC" 
    Font-Bold="False" HorizontalAlign="Left" Width="70%" ColumnSpan="4"> 
  <asp:Label ID="Label6" runat="server" 
      text="Maximum Number of Points for Chart Display: " 
      ForeColor="#FFFFCC" Font-Bold="False" Font-Size="10" >
  </asp:Label>&nbsp; 
  <asp:ComboBox ID="MaxPntsDrpDn" runat="server" AutoPostBack="True" BackColor="Black" 
      BorderColor="#333333" BorderStyle="Inset" BorderWidth="2" Font-Names="Arial" 
      Font-Size="10" ForeColor="#FFFFCC" AppendDataBoundItems="False" 
      ItemInsertLocation="Append" OnTextChanged="MaxPntsDrpDn_TextChanged">
    <asp:ListItem>100</asp:ListItem>
    <asp:ListItem>200</asp:ListItem>
    <asp:ListItem>300</asp:ListItem>
    <asp:ListItem>400</asp:ListItem>
  </asp:ComboBox>
  <asp:Button ID="MaxPntBtn" runat="server" Text="Select"  
      UseSubmitBehavior="True" OnClientClick="MaxPntBtn_Click" />
</asp:TableCell>

Open in new window

rckrchAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CodeCruiserCommented:
In your button, you have

OnClientClick="MaxPntBtn_Click"

which means you have a Javascript function of that name that you want to execute but the function actually is not Javascript. So you need to change

OnClientClick="MaxPntBtn_Click"

to

OnClick="MaxPntBtn_Click"
rckrchAuthor Commented:
Thanks Code Cruiser, but I tried that again and nothing happens.  Clicking the button - does not fire.

Protected Sub MaxPntBtn_Click() Handles MaxPntBtn.Click
        Call MetricDrpDn_SelectedIndexChanged()
    End Sub
    Protected Sub MaxPntsDrpDn_TextChanged() Handles MaxPntsDrpDn.TextChanged
        Call MetricDrpDn_SelectedIndexChanged()
    End Sub

<asp:ComboBox ID="MaxPntsDrpDn" runat="server" AutoPostBack="True" BackColor="Black"
                                BorderColor="#333333" BorderStyle="Inset" BorderWidth="2" Font-Names="Arial"
                                Font-Size="10" ForeColor="#FFFFCC" AppendDataBoundItems="False"
                                ItemInsertLocation="Append" OnTextChanged="MaxPntsDrpDn_TextChanged">
                                    <asp:ListItem>100</asp:ListItem>
                                    <asp:ListItem>200</asp:ListItem>
                                    <asp:ListItem>300</asp:ListItem>
                                    <asp:ListItem>400</asp:ListItem>
                                </asp:ComboBox>
                        <asp:Button ID="MaxPntBtn" runat="server" Text="Select"  
                        UseSubmitBehavior="True" OnClick="MaxPntBtn_Click" />
CodeCruiserCommented:
Well, to be honest, you don't need any of it as you are using the Handles clause in your code behind.

When you say nothing happens, do you mean the browser does not post back or do you mean a post back is happening but expected end result is not being achieved?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rckrchAuthor Commented:
Thanks for the response code cruiser.  When the button is clicked it initiates the procedure appropriately and proceeds through the called procedure.  But the screen (chart) is not updated, which is what this is for.  When I change the combo box with the options that are already there the program works fine and the chart is updated to change the range of data used.  However, when I manually add a unique value to the combo box, then push the button it proceeds through the called sub with the revised variable value, but does not update the chart.

Thanks again for the response.
rckrchAuthor Commented:
Well, I found the problem.  I failed to include the button click event as one of the triggers in the update panel.  Thanks very much code cruiser for responding.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.