Solved

why is this asp button wrong?

Posted on 2015-01-04
5
150 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

806 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