Solved

why is this asp button wrong?

Posted on 2015-01-04
5
147 Views
Last Modified: 2015-01-28
each of the button on my web page give an error that the onclick function I call is not a member of asp.addinglabel_aspx
in addinglabel.aspx.vb is the funcition below

addinglabel.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!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> TIME SHEET </title>      
           <link rel="stylesheet" type="text/css" href="wages.css"/>            
</head>
<body>  
  <form id="form1" runat="server">
   <h1>Monthly Hours Sheet</h1>
    <div id="div4">
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>
    </div>
    <div id="div1">
    <asp:Label
    ID="Labelex1"
    runat="server"      
    Text="Time is entered on a 24 hour clock, use 15 min increments. It is simple, you come at 8:00, 4 hours later which is 12.">    
    </asp:Label>
     <br />
     <asp:Label
    ID="Labelex2"
    runat="server"        
    Text="You go to lunch for an hour, it is now 13; work 4 more hours it is 17:00. You've been here 9 hours and worked 8.">    
    </asp:Label>
       </div>
     
     <div id="div2">
     <asp:Label
        ID="Label1"
        runat="server"  
        Text="Enter Your Soc. Sec Number ">
        </asp:Label>    

     <asp:TextBox
        ID="TextBoxSocSec"
        Text=""
        AutoPostBack="False"                  
        runat="server">
        </asp:TextBox>

         <asp:Button
        ID="Button1"  
        runat="server"  
             
        Text="Submit Soc. Sec #"        
        OnClick= "btnSubmit_Click"/>    'here is sub
        <br />
          <asp:Label ID="Labelname" runat="server" Text="Name "></asp:Label>  
                 <asp:TextBox ID="TextBoxName" runat="server" ReadOnly="True"></asp:TextBox>  

         <asp:Label ID="LabelSymCode" runat="server" Text="Symitar Code "></asp:Label>
                 <asp:TextBox ID="TextBoxCode" runat="server" ReadOnly="True"></asp:TextBox>

         <asp:Label ID="LabelTD" runat="server" Text="Todays Date "></asp:Label>
                 <asp:TextBox ID="TextBoxNow" runat="server" ReadOnly="True"></asp:TextBox>
          <br />  
       
     </div>
      <asp:Label ID="Labelex3" runat="server" Text="You will see listing of Accumulated hours and used hours as of the first of month. "></asp:Label>
        <asp:Label ID="Labelex4" runat="server" Text="All calculations and recalculations are done from First of Month Numbers. "></asp:Label>
        <br />
         
         <asp:Label ID="LabelPtoAccum" runat="server" Text="Pto Accummulated     "></asp:Label>  
                 <asp:TextBox ID="TextPtoAccum" runat="server" ReadOnly="True"></asp:TextBox>  

         <asp:Label ID="LabelPtoFM" runat="server" Text="Pto 1st of Month     "></asp:Label>
                 <asp:TextBox ID="TextPtoFM" runat="server" ReadOnly="True"></asp:TextBox>

         <asp:Label ID="LabelPtoUsed" runat="server" Text="Pto Currently Claimed     "></asp:Label>
                 <asp:TextBox ID="TextPtoUsed" runat="server" ReadOnly="True"></asp:TextBox>
          <br />  
          <asp:Label ID="LabelBorrowAccum" runat="server" Text="Pto Allow  Borrow  "></asp:Label>  
                 <asp:TextBox ID="TextBorrow" runat="server" ReadOnly="True"></asp:TextBox>

         <asp:Label ID="LabelBorrowFM" runat="server" Text="Pto Borrowed 1st of Month  "></asp:Label>
                 <asp:TextBox ID="TextBorrowFM" runat="server" ReadOnly="True"></asp:TextBox>

         <asp:Label ID="LabelBorrowUsed" runat="server" Text="PTO Borrowed  "></asp:Label>  
                 <asp:TextBox ID="TextBorrowUsed" runat="server" ReadOnly="True"></asp:TextBox>    
     
        <br />

         <asp:Label ID="LabelSickAccum" runat="server" Text="Sick Accummulated  "></asp:Label>  
                  <asp:TextBox ID="TextSickAccum" runat="server" ReadOnly="True"></asp:TextBox>  

         <asp:Label ID="LabelSickFM" runat="server" Text="Sick 1st of Month  "></asp:Label>
                 <asp:TextBox ID="TextSickFM" runat="server" ReadOnly="True"></asp:TextBox>

         <asp:Label ID="LabelSickUsed" runat="server" Text="Sick Currently Claimed  "></asp:Label>  
                 <asp:TextBox ID="TextSickUsed" runat="server" ReadOnly="True"></asp:TextBox>
        <br />    
       
     
     

    <div id="div5">
       
  <asp:gridview id="CustomersGridView"  
       autogeneratecolumns="false"
        autogenerateeditbutton="false"  
       
               
        runat="server">  
        <columns>
       
          <asp:boundfield datafield="WORKDATE"
            readonly="true"      
            headertext="DATE"/>
           
            <asp:boundfield datafield="DAYOFWEEK"
            readonly="true"      
            headertext="DAY IN WEEK"/>

             <asp:TemplateField HeaderText="Authorize">        
               <ItemTemplate>          
                  <asp:TextBox ID="tbauthorizedcode" runat="server" Width="80%"></asp:TextBox>
                </ItemTemplate>
            </asp:TemplateField>

           <asp:TemplateField HeaderText="IN">          
             <ItemTemplate>          
             <asp:DropDownList ID="ddlin" runat="server"  >                                      
                 </asp:DropDownList>  
                   </ItemTemplate>                            
             </asp:TemplateField>    

        <asp:TemplateField HeaderText="OUT">
           <ItemTemplate>          
             <asp:DropDownList ID="ddlout" runat="server"  >              
                 </asp:DropDownList>  
           </ItemTemplate>          
        </asp:TemplateField>

        <asp:TemplateField HeaderText="LUNCH">
           <ItemTemplate>          
             <asp:DropDownList ID="ddllunch" runat="server"  >              
             </asp:DropDownList>  
           </ItemTemplate>          
        </asp:TemplateField>

         <asp:TemplateField HeaderText="LUNCH IN">
           <ItemTemplate>                
             <asp:DropDownList ID="ddllunchin" runat="server"  >              
             </asp:DropDownList>    
            </ItemTemplate>        
         </asp:TemplateField>

           <asp:TemplateField HeaderText="Pto Detail">
             <ItemTemplate>
                <asp:DropDownList ID="ddlptodetail" runat="server">                
                </asp:DropDownList>              
             </ItemTemplate>
           </asp:TemplateField>

            <asp:TemplateField HeaderText="Pto PAID">
               <ItemTemplate>          
                   <asp:TextBox ID="tbptopaid" runat="server" Width="80%"></asp:TextBox>
               </ItemTemplate>  
            </asp:TemplateField>

           

           <asp:TemplateField HeaderText="COMP Pto">          
            <ItemTemplate>          
               <asp:DropDownList ID="ddlcomppto" runat="server">                
               </asp:DropDownList>              
            </ItemTemplate>
           </asp:TemplateField>

             <asp:TemplateField HeaderText="COMP PAID">        
               <ItemTemplate>          
                  <asp:TextBox ID="tbcomppaid" runat="server" Width="80%"></asp:TextBox>
                </ItemTemplate>
            </asp:TemplateField>

           

         </columns>
      </asp:gridview>
       
 </div>
  <div id="div6">        
        <br />
      <asp:TextBox ID="Message" runat="server" forecolor="Red" ReadOnly="True"></asp:TextBox>      
   
         <br />
 
        <br />
 
      <asp:Button ID="BTNUPDATE" runat="server" Text="Button" Onclick="btnUpdate_Click"/>  ' second call
    </div>    
  </form>  
</body>
</html>

addinglabel.aspx.vb
both of the subs are formed the same so only including one
 Public Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim dodisable As Boolean
        Dim stoploop As Integer
        'disable_gridedit(sender, e)
        Message.Text = ""
        Label1.Visible = False
        Button1.Visible = False
        TextBoxSocSec.Visible = False
        dodisable = Check_Updates(sender, e)
        If dodisable = True Then
            dodisable = writetosql(sender, e)
            If dodisable = True Then
                dodisable = fill_textbox(sender, e)
                If dodisable = True Then
                    stoploop = filltable(sender, e, TextBoxCode.Text, TextBorrowFM.Text, TextPtoFM.Text, TextSickFM.Text)
                    Message.text = ""
                End If
            End If
        Else
        End If


    End Sub
0
Comment
Question by:javagair
5 Comments
 
LVL 77

Accepted Solution

by:
arnold earned 500 total points
ID: 40530910
OnClick is an event seen by the browser not on the server.  Load the page in a browser and view source.

If you want your page working in all browsers, you should use javascript a to handle user interactions with your page in the browser.
0
 
LVL 22

Expert Comment

by:Snarf0001
ID: 40530940
arnold: In the case of an asp:Button, OnClick is a server event, not a client one.

javagair: initial guess, the code you posted has the "CodeFile" set to Default.aspx.vb, not addinglabel.aspx.vb.
Try changing that, the rest of your code looked fine.  If it doesn't work, pls post the full code from the .vb file as well.
0
 
LVL 77

Expert Comment

by:arnold
ID: 40530971
Thanks, snarf for the correction.
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 40531281
Initial guess would be that you are missing the "Handles" clause.  Try changing the signature to:
Public Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click

Open in new window

0
 

Author Closing Comment

by:javagair
ID: 40576421
only java script fixed the problem
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now