Link to home
Start Free TrialLog in
Avatar of jeff Lee
jeff Lee

asked on

After use updatepanel control, can't detect which key I press

Hi,

   The following is my code- To detect which key I press, and it can work well.
  <asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
   <script language="VBScript" type="text/vbscript">
      Sub document_onkeydown()
       if (window.event.keyCode="113") then
        document.getElementById("<%=A.ClientID %>").focus()
       elseif (window.event.keyCode="121") then
        document.getElementById("<%=B.ClientID %>").focus()
       elseif (window.event.keyCode="118") then
        document.getElementById("<%=C.ClientID %>").checked=true
       elseif (window.event.keyCode="119") then
        document.getElementById("<%=D.ClientID %>").checked=true
        document.getElementById("<%=E.ClientID %>")
       elseif (window.event.keyCode="120") then
        document.getElementById("<%=F.ClientID %>").checked=true  
       End If
      End Sub
    </script>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" ViewStateMode="Enabled"
            UpdateMode="Conditional">
            <ContentTemplate>
    .......
    .......
    </asp:UpdatePanel>
  </asp:Content>

    Now I use updatepanel control in asp.net(VB),I can't detect which key I press. What is this error and how can I resolve it ?  Thanks.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.