CS1061: 'ASP.createradreferral_aspx' does not contain a definition for 'btnSubmitRad_Click' and no extension method 'btnSubmitRad_Click' accepting a first argument of type 'ASP.createradreferral_aspx'

I have created a web form with some labels and text boxes.  I created one button at the bottom of the form which writes all the data to a table.  When I run the app I get this error message:

CS1061: 'ASP.createradreferral_aspx' does not contain a definition for 'btnSubmitRad_Click' and no extension method 'btnSubmitRad_Click' accepting a first argument of type 'ASP.createradreferral_aspx' could be found (are you missing a using directive or an assembly reference?)


Line 149:                    </igtxt:WebTextEdit>
Line 150:    
Line 151:                    <igtxt:WebImageButton ID="btnSubmitRad" runat="server"
Line 152:                        onclick="btnSubmitRad_Click"
Line 153:                        style="z-index: 1; left: 471px; top: 386px; position: absolute"



When I check to see if I did something wrong, I could not find anything.  I then deleted the button, dragged a new button on the canvas and recopied the code for the button.  I got the same error message.

Any help is greatly appreciated.

Here is the ASP.net code and the C# code:
<%@ Page Language="C#" MasterPageFile="~/Radiology Scheduling Portal.Master" AutoEventWireup="true" CodeBehind="CreateRadReferral.aspx.cs" Inherits="RadRelay35sp1.WebForm1" Title="Untitled Page" %>
<%@ Register assembly="Infragistics35.WebUI.Misc.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.Misc" tagprefix="igmisc" %>
<%@ Register assembly="Infragistics35.WebUI.WebDataInput.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.WebDataInput" tagprefix="igtxt" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
 
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 
 
    <asp:Panel ID="Panel1" runat="server">
                    
                    
                    <asp:Label ID="lblBiopsyOf" runat="server" Style="z-index: 100; left: 281px; position: absolute;
                        top: 51px" Text="Biopsy of:" ForeColor="Black"></asp:Label>
                        
                    <asp:Label ID="lblArteriogram" runat="server" Style="z-index: 101; left: 267px; position: absolute;
                        top: 75px" Text="Arteriogram:" ForeColor="Black"></asp:Label>
                        
                    <asp:Label ID="lblOtherInterventional" runat="server" Style="z-index: 102; left: 221px;
                        position: absolute; top: 102px" Text="Other Interventional:" 
                        ForeColor="Black"></asp:Label>
                        
                    <asp:Label ID="lblMRI" runat="server" Style="z-index: 103; left: 304px; position: absolute;
                        top: 126px; height: 19px;" Text="MRI:" ForeColor="Black"></asp:Label>
                        
                    <asp:CheckBox ID="cbmriwocontrast" runat="server" Style="z-index: 104; left: 702px;
                        position: absolute; top: 126px; width: 114px;" 
                        Text="w/o contrast" ForeColor="Black" />
            
                    <asp:CheckBox ID="cbmriwwocontrast" runat="server" Style="z-index: 105; left: 820px;
                        position: absolute; top: 126px; width: 121px;" 
                        Text="w/wo contrast" ForeColor="Black" Height="20px" />
                    
                    <asp:Label ID="lblMRA" runat="server" Style="z-index: 106; left: 300px; position: absolute;
                        top: 152px" Text="MRA:" ForeColor="Black"></asp:Label>
                    
                    <asp:CheckBox ID="cbmrawwocontrast" runat="server" Style="z-index: 107; left: 818px;
                        position: absolute; top: 152px; width: 122px;" Text="w/wo contrast" 
                        ForeColor="Black" Height="20px" />
                   
                    <asp:CheckBox ID="cbmrawcontrast" runat="server" Style="z-index: 108; left: 936px;
                        position: absolute; top: 152px; width: 145px;" Text="w contrast" 
                        Height="20px" ForeColor="Black" />
                                       
                    <asp:CheckBox ID="cbmrawocontrast" runat="server" Text="w o contrast" style="z-index: 132; left: 703px;
                        position: absolute; top: 151px; width: 107px;" ForeColor="Black" />
                    
                  
                        
                    <asp:Label ID="lblGeneralXray" runat="server" Style="z-index: 109; left: 249px; position: absolute;
                        top: 178px" Text="General X-Ray" ForeColor="Black"></asp:Label>
                    
                    <asp:Label ID="lblMammo" runat="server" Style="z-index: 110; left: 148px; position: absolute;
                        top: 205px; width: 197px;" Text="Mammo and Breast Diagnostics" 
                        ForeColor="Black"></asp:Label>
                    
                    <asp:Label ID="lblMammoBreast" runat="server" Style="z-index: 111; left: 259px; position: absolute;
                        top: 231px" Text="Bone Density" ForeColor="Black"></asp:Label>
                    
                    <asp:Label ID="lblFluoro" runat="server" Style="z-index: 112; left: 263px; position: absolute;
                        top: 257px" Text="Fluoroscopy" ForeColor="Black"></asp:Label>
                    
                    <asp:Label ID="lblct" runat="server" Style="z-index: 113; left: 318px; position: absolute;
                        top: 282px" Text="CT:" ForeColor="Black"></asp:Label>
                    
                    <asp:CheckBox ID="cbCTwocontrast" runat="server" Style="z-index: 114; left: 710px;
                        position: absolute; top: 282px; width: 99px;" Text="w/o contrast" 
                        ForeColor="Black" />
                    
                    <asp:CheckBox ID="cbCTwwocontrast" runat="server" Style="z-index: 115; left: 814px;
                        position: absolute; top: 283px; width: 115px; height: 18px;" 
                        Text="w/wo contrast" ForeColor="Black" />
                    
                    <asp:CheckBox ID="cbCTwcontrast" runat="server" Style="z-index: 116; left: 927px;
                        position: absolute; top: 284px; width: 91px;" Text="w contrast" 
                        ForeColor="Black" Height="20px" />
                    
                    <asp:Label ID="lblUltrasound" runat="server" Style="z-index: 117; left: 276px; position: absolute;
                        top: 307px" Text="Ultrasound" ForeColor="Black"></asp:Label>
                    
                    <asp:Label ID="lblnuclearmed" runat="server" Style="z-index: 118; left: 233px; position: absolute;
                        top: 334px" Text="Nuclear Medicine:" ForeColor="Black"></asp:Label>
                    
                    <igtxt:WebTextEdit ID="tbBiopsyOf" runat="server" Style="z-index: 119; left: 360px;
                        position: absolute; top: 49px" Width="331px">
                    </igtxt:WebTextEdit>
                    
                    <igtxt:WebTextEdit ID="tbArteriogram" runat="server" Style="z-index: 120; left: 360px;
                        position: absolute; top: 74px" Width="331px">
                    </igtxt:WebTextEdit>
                    
                    <igtxt:WebTextEdit ID="tbOtherInterven" runat="server" Style="z-index: 121; left: 360px;
                        position: absolute; top: 99px" Width="331px">
                    </igtxt:WebTextEdit>
                    
                    <igtxt:WebTextEdit ID="tbMRI" runat="server" Style="z-index: 122; left: 360px; position: absolute;
                        top: 125px" Width="331px">
                    </igtxt:WebTextEdit>
                    
                    <igtxt:WebTextEdit ID="tbMRA" runat="server" Style="z-index: 123; left: 360px; position: absolute;
                        top: 151px" Width="331px">
                    </igtxt:WebTextEdit>
                    
                    <igtxt:WebTextEdit ID="tbGeneralXray" runat="server" Style="z-index: 124; left: 360px;
                        position: absolute; top: 177px; right: 506px;" Width="331px">
                    </igtxt:WebTextEdit>
                    
                    <igtxt:WebTextEdit ID="tbMammo" runat="server" Style="z-index: 125; left: 360px;
                        position: absolute; top: 203px; height: 20px;" Width="331px">
                    </igtxt:WebTextEdit>
                    
                    <igtxt:WebTextEdit ID="tbBoneDensity" runat="server" Style="z-index: 126; left: 360px;
                        position: absolute; top: 229px" Width="331px">
                    </igtxt:WebTextEdit>
                    
                    <igtxt:WebTextEdit ID="tbFlouroscopy" runat="server" Style="z-index: 127; left: 360px;
                        position: absolute; top: 255px" Width="331px">
                    </igtxt:WebTextEdit>
                    
                    <igtxt:WebTextEdit ID="tbCT" runat="server" Style="z-index: 128; left: 360px; position: absolute;
                        top: 281px" Width="331px">
                    </igtxt:WebTextEdit>
                    
                    <igtxt:WebTextEdit ID="tbUltrasound" runat="server" Style="z-index: 129; left: 360px;
                        position: absolute; top: 307px" Width="331px">
                    </igtxt:WebTextEdit>
                    
                    <igtxt:WebTextEdit ID="tbNuclearMed" runat="server" Style="z-index: 130; left: 360px;
                        position: absolute; top: 332px" Width="331px">
                    </igtxt:WebTextEdit>
                    
                  
                    &nbsp;&nbsp;
                    
                    <asp:CheckBox ID="cbmriwcontrast" runat="server" Text="w contrast" 
                        style="z-index: 131; left: 937px; position: absolute; top: 126px; width: 119px;" 
                         ForeColor="Black" Height="20px" />
                         
                    
                        
                    &nbsp;&nbsp;
                    
                    <asp:Label ID="lblOrderNumber" runat="server" Style="z-index: 133; left: 819px; position: absolute;
                        top: 30px; width: 124px;" Text="Order Number"></asp:Label>
                    
                    <igtxt:WebTextEdit ID="WebTextEdit1" runat="server" Style="z-index: 135; left: 815px;
                                position: absolute; top: 58px; width: 102px;">
                    </igtxt:WebTextEdit>
    
 
 
--------------------------     HERE IS THE BUTTON THAT HAS THE ERROR ------------------------
 
 
 
                    <igtxt:WebImageButton ID="btnSubmitRad" runat="server" 
                        onclick="btnSubmitRad_Click" 
                        style="z-index: 1; left: 471px; top: 386px; position: absolute" 
                        Text="Submit Referral">
                    </igtxt:WebImageButton>
                   
    
    </asp:Panel>
 
                    
</asp:Content>
 
 
 
 
 
 
 
 
 
Here is the C# Code:
 
 
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
 
namespace RadRelay35sp1
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        protected void btnSubmitRadRef_Click(object sender, Infragistics.WebUI.WebDataInput.ButtonEventArgs e)
        {
 
            
        }
 
 
        private static void UpdateTable(RadRelayDataClassDataContext db, Object record)
        {
            string type = record.GetType().Name;
 
 
            // ---------------  Write Treatment Record -------------------------
 
 
            if (type == "PROVIDER_REFERRAL_QUEUE")
            {
                
                db.PROVIDER_REFERRAL_QUEUEs.InsertOnSubmit(record as PROVIDER_REFERRAL_QUEUE);
 
                try
                {
                    // Attempt to update the database
                    Console.WriteLine(String.Format("About to Submit Changes for PROVIDER_REFERRAL_QUEUE"));
                    db.SubmitChanges();
                    Console.WriteLine("No Duplicate PROVIDER_REFERRAL_QUEUE Record");
 
                }
                catch (DuplicateKeyException duppatexc)
                {
                    // This DuplicateKeyException is a Linq exception for duplicate keys that exist
                    // in the DataContect and not the database, reason why it was not catching it.
                    // Remove record from DataContext and continue.
                    switch (type)
                    {
 
                        case "PROVIDER_REFERRAL_QUEUE":
                            // Using exception object duppatexc to print the error message
                            Console.WriteLine("Duplicate Record in Memory Treatment\n" + duppatexc.Message);
 
                            db.PROVIDER_REFERRAL_QUEUEs.DeleteOnSubmit(record as PROVIDER_REFERRAL_QUEUE);
                            break;
                    }
 
                }
                catch (SqlException sqle)
                {
                    
 
                    // This is a duplicate record found in the database, remove record DataContext.
                    switch (type)
                    {
                        case "PROVIDER_REFERRAL_QUEUE":
                            Console.WriteLine("Duplicate Record in SQL Table PROVIDER_REFERRAL_QUEUE\n" + sqle.Message);
                            db.PROVIDER_REFERRAL_QUEUEs.DeleteOnSubmit(record as PROVIDER_REFERRAL_QUEUE);
                            break;
                    }
                }
            }
 
        }
        
 
 
//  ------------------  HERE IS THE BUTTON REFERRED TO IN ASP.NET CODE  ---------------
		
		
        protected void btnSubmitRad_Click(object sender, Infragistics.WebUI.WebDataInput.ButtonEventArgs e)
        {
 
            RadRelayDataClassDataContext dcRadRelay = new RadRelayDataClassDataContext();
 
 
            PROVIDER_REFERRAL_QUEUE myProviderReferralQueue = new PROVIDER_REFERRAL_QUEUE();
 
            myProviderReferralQueue.REFERRAL_QUEUE_ID = Guid.NewGuid();
 
            myProviderReferralQueue.BIOPSY = tbBiopsyOf.Text;
            
 
        }
 
    }
}

Open in new window

kwh3856Asked:
Who is Participating?
 
GiftsonDJohnCommented:
Hi,

It is probably because of namespace in web page. Normally asp.net 2.0 and above doesn't use namespace in the web pages. Try replacing the Page tag as below

<%@ Page Language="C#" MasterPageFile="~/Radiology Scheduling Portal.Master" AutoEventWireup="true" CodeBehind="CreateRadReferral.aspx.cs" Inherits="WebForm1" Title="Untitled Page" %>

and remove the

namespace RadRelay35sp1
{
}
from the code
0
 
kwh3856Author Commented:
Line 153 is where the button error is
 
and then again on Line 266
 
 
0
 
GiftsonDJohnCommented:
Hi,

Is the reference added properly. If yes and check the namespace Infragistics.WebUI.WebDataInput is correct or not.
0
 
kwh3856Author Commented:
GiftsonDJohn,
I tried removing the Infragistics button and using the one from Microsoft and got the exact same error message.  Any ideas?
Thanks
Kenny
 
0
 
kwh3856Author Commented:
That did not work either.  Any ideas?
 
Thanks
Kenny
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.