Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

why is this asp button wrong?

Posted on 2015-01-04
5
Medium Priority
?
164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 79

Accepted Solution

by:
arnold earned 2000 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 23

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 79

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

721 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