Solved

why is this asp button wrong?

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

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 76

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

18 Experts available now in Live!

Get 1:1 Help Now