Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Web Deployment error for WebUserControl event [modified]

Web Deployment error for WebUserControl event [modified]

Scheduled Pinned Locked Moved ASP.NET
sysadminhelp
12 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    K V Sekhar
    wrote on last edited by
    #1

    Hi All, I am deploying my website by using add webdeployment project. But in my website i have used the WebUserControls in my website. The WebUserControls events are handled in form[which contains WebUserControl] through Delegates & Event Handlers. These events of WebUserControl have been initialized at form Default.aspx Page Init event. When i build the Project it gives no errors, the site runs perfectly... But when build the Deployment project i got a compilation errors of WebUserControl events where i initilized at form Default.aspx page init event. Its giving error message like 'MyUserControlUC' could not found are u missing add reference. For sample: ========== MyUserControlUC.ascx

    //delegate
    public delegate void DropDownSelectedIndexChanged(object sender, EventsArgs e);
    //event
    public event DropDownSelectedIndexChanged IndexChanged;
    //call the event
    protected void ddl_items_SelectedIndex_Changed(object sender, EventsArgs e)
    {
    if(IndexChanged != null)
    IndexChanged(sender,e);
    }

    Default.aspx

    <%@ Register TagPrefix="uc1" TagName="SampleUserControl" Src="~/MyUserControlUC.ascx" %>

    Default.aspx.cs

    protected override void OnInit(EventArgs e)
    {
    base.OnInit(e);
    InitializeComponent();
    }
    private void InitializeComponent()
    {
    this.Load += new EventHandler(this.Page_Load);
    SampleUserControl1.IndexChanged += new ASP.MyUserControlUC.SelectedIndexChanged(ddl_items_SelectedIndexChanged);//Here i am getting error while building deployment project.
    }

    private void ddl_items_SelectionIndexChanged(Object sender, EventArgs e)
    {
    //Code here to handle ...
    }

    Thanks & Regards

    modified on Tuesday, February 16, 2010 8:06 AM

    D N 2 Replies Last reply
    0
    • K K V Sekhar

      Hi All, I am deploying my website by using add webdeployment project. But in my website i have used the WebUserControls in my website. The WebUserControls events are handled in form[which contains WebUserControl] through Delegates & Event Handlers. These events of WebUserControl have been initialized at form Default.aspx Page Init event. When i build the Project it gives no errors, the site runs perfectly... But when build the Deployment project i got a compilation errors of WebUserControl events where i initilized at form Default.aspx page init event. Its giving error message like 'MyUserControlUC' could not found are u missing add reference. For sample: ========== MyUserControlUC.ascx

      //delegate
      public delegate void DropDownSelectedIndexChanged(object sender, EventsArgs e);
      //event
      public event DropDownSelectedIndexChanged IndexChanged;
      //call the event
      protected void ddl_items_SelectedIndex_Changed(object sender, EventsArgs e)
      {
      if(IndexChanged != null)
      IndexChanged(sender,e);
      }

      Default.aspx

      <%@ Register TagPrefix="uc1" TagName="SampleUserControl" Src="~/MyUserControlUC.ascx" %>

      Default.aspx.cs

      protected override void OnInit(EventArgs e)
      {
      base.OnInit(e);
      InitializeComponent();
      }
      private void InitializeComponent()
      {
      this.Load += new EventHandler(this.Page_Load);
      SampleUserControl1.IndexChanged += new ASP.MyUserControlUC.SelectedIndexChanged(ddl_items_SelectedIndexChanged);//Here i am getting error while building deployment project.
      }

      private void ddl_items_SelectionIndexChanged(Object sender, EventArgs e)
      {
      //Code here to handle ...
      }

      Thanks & Regards

      modified on Tuesday, February 16, 2010 8:06 AM

      D Offline
      D Offline
      Dinesh Mani
      wrote on last edited by
      #2

      If you are having the UCs in different project from the main web site, then check if the Build order of the solution is set correctly and check if you have enabled compiling the primary assembly and all it dependencies. HTH!

      K 1 Reply Last reply
      0
      • D Dinesh Mani

        If you are having the UCs in different project from the main web site, then check if the Build order of the solution is set correctly and check if you have enabled compiling the primary assembly and all it dependencies. HTH!

        K Offline
        K Offline
        K V Sekhar
        wrote on last edited by
        #3

        Hi Dinesh, Thanks for ur reply. But the WebUserControl are in sample project.i.e, in main website it self Regards, kv sekhar

        D 1 Reply Last reply
        0
        • K K V Sekhar

          Hi Dinesh, Thanks for ur reply. But the WebUserControl are in sample project.i.e, in main website it self Regards, kv sekhar

          D Offline
          D Offline
          Dinesh Mani
          wrote on last edited by
          #4

          mm, try qualifying the UC with it relative path like so - <%@ Register TagPrefix="uc1" TagName="SampleUserControl" Src="~/MyUserControlUC.ascx" %> This denotes taht "MyUserControlUC" is available in the application root folder.

          K 1 Reply Last reply
          0
          • D Dinesh Mani

            mm, try qualifying the UC with it relative path like so - <%@ Register TagPrefix="uc1" TagName="SampleUserControl" Src="~/MyUserControlUC.ascx" %> This denotes taht "MyUserControlUC" is available in the application root folder.

            K Offline
            K Offline
            K V Sekhar
            wrote on last edited by
            #5

            Hi Dinesh, <%@ Register TagPrefix="uc1" TagName="SampleUserControl" Src="~/MyUserControlUC.ascx" %> is right, in the post i wrote wrong. In register tag no error. Problem with at Initilization of UserControl events in form. any suggestions is appreciated.. Thanks & regards, kv sekhar

            D 1 Reply Last reply
            0
            • K K V Sekhar

              Hi Dinesh, <%@ Register TagPrefix="uc1" TagName="SampleUserControl" Src="~/MyUserControlUC.ascx" %> is right, in the post i wrote wrong. In register tag no error. Problem with at Initilization of UserControl events in form. any suggestions is appreciated.. Thanks & regards, kv sekhar

              D Offline
              D Offline
              Dinesh Mani
              wrote on last edited by
              #6

              Can you post the exact compilation message and the reference line number? Well, I can't think of whats going wrong. Hard luck.

              modified on Tuesday, February 16, 2010 5:21 AM

              K 1 Reply Last reply
              0
              • K K V Sekhar

                Hi All, I am deploying my website by using add webdeployment project. But in my website i have used the WebUserControls in my website. The WebUserControls events are handled in form[which contains WebUserControl] through Delegates & Event Handlers. These events of WebUserControl have been initialized at form Default.aspx Page Init event. When i build the Project it gives no errors, the site runs perfectly... But when build the Deployment project i got a compilation errors of WebUserControl events where i initilized at form Default.aspx page init event. Its giving error message like 'MyUserControlUC' could not found are u missing add reference. For sample: ========== MyUserControlUC.ascx

                //delegate
                public delegate void DropDownSelectedIndexChanged(object sender, EventsArgs e);
                //event
                public event DropDownSelectedIndexChanged IndexChanged;
                //call the event
                protected void ddl_items_SelectedIndex_Changed(object sender, EventsArgs e)
                {
                if(IndexChanged != null)
                IndexChanged(sender,e);
                }

                Default.aspx

                <%@ Register TagPrefix="uc1" TagName="SampleUserControl" Src="~/MyUserControlUC.ascx" %>

                Default.aspx.cs

                protected override void OnInit(EventArgs e)
                {
                base.OnInit(e);
                InitializeComponent();
                }
                private void InitializeComponent()
                {
                this.Load += new EventHandler(this.Page_Load);
                SampleUserControl1.IndexChanged += new ASP.MyUserControlUC.SelectedIndexChanged(ddl_items_SelectedIndexChanged);//Here i am getting error while building deployment project.
                }

                private void ddl_items_SelectionIndexChanged(Object sender, EventArgs e)
                {
                //Code here to handle ...
                }

                Thanks & Regards

                modified on Tuesday, February 16, 2010 8:06 AM

                N Offline
                N Offline
                Nath
                wrote on last edited by
                #7

                Could u provide the information details whats the error or at the root itself can u specify it clealy

                K A 2 Replies Last reply
                0
                • D Dinesh Mani

                  Can you post the exact compilation message and the reference line number? Well, I can't think of whats going wrong. Hard luck.

                  modified on Tuesday, February 16, 2010 5:21 AM

                  K Offline
                  K Offline
                  K V Sekhar
                  wrote on last edited by
                  #8

                  Hi Dinesh, Sorry for late response... The exact error message is

                  1.System.Web.UI.UserControl does not contain a definition for 'IndexChanged' and no extension method 'IndexChanged' accepting a first arguement of type 'System.Web.UI.UserControl' could be found.(are u missing a using directive or an assembly reference)

                  2.The type or namespace name 'MyUserControlUC' doesn't exist in the namespace 'ASP' (are u missing an assembly reference?)

                  This error i got at Default.aspx.cs page private void InitializeComponent() { this.Load += new EventHandler(this.Page_Load); SampleUserControl1.IndexChanged += new ASP.MyUserControlUC.SelectedIndexChanged(ddl_items_SelectedIndexChanged);//Here i am getting error while building deployment project. } regards, kv sekhar

                  D 1 Reply Last reply
                  0
                  • N Nath

                    Could u provide the information details whats the error or at the root itself can u specify it clealy

                    K Offline
                    K Offline
                    K V Sekhar
                    wrote on last edited by
                    #9

                    Hi Nath, Sorry for late response... The exact error message is

                    1.System.Web.UI.UserControl does not contain a definition for 'IndexChanged' and no extension method 'IndexChanged' accepting a first arguement of type 'System.Web.UI.UserControl' could be found.(are u missing a using directive or an assembly reference)

                    2.The type or namespace name 'MyUserControlUC' doesn't exist in the namespace 'ASP' (are u missing an assembly reference?)

                    This error i got at Default.aspx.cs page private void InitializeComponent() { this.Load += new EventHandler(this.Page_Load); SampleUserControl1.IndexChanged += new ASP.MyUserControlUC.SelectedIndexChanged(ddl_items_SelectedIndexChanged);//Here i am getting error while building deployment project. } regards, kv sekhar

                    1 Reply Last reply
                    0
                    • K K V Sekhar

                      Hi Dinesh, Sorry for late response... The exact error message is

                      1.System.Web.UI.UserControl does not contain a definition for 'IndexChanged' and no extension method 'IndexChanged' accepting a first arguement of type 'System.Web.UI.UserControl' could be found.(are u missing a using directive or an assembly reference)

                      2.The type or namespace name 'MyUserControlUC' doesn't exist in the namespace 'ASP' (are u missing an assembly reference?)

                      This error i got at Default.aspx.cs page private void InitializeComponent() { this.Load += new EventHandler(this.Page_Load); SampleUserControl1.IndexChanged += new ASP.MyUserControlUC.SelectedIndexChanged(ddl_items_SelectedIndexChanged);//Here i am getting error while building deployment project. } regards, kv sekhar

                      D Offline
                      D Offline
                      Dinesh Mani
                      wrote on last edited by
                      #10

                      From the first post, your IndexChanged event is of type (Delegate) DropDownSelectedIndexChanged. Where as you are trying to assign it to a delegate of type MyUserControlUC.SelectedIndexChanged. You should actually be assigning it to MyUserControlUC.DropDownSelectedIndexChanged.That is what the error message implies too. You have used the namespace qualifier "ASP" to assign the IndexChanged event handler. Is this namespace correct?? Try the changes, it might do the trick. HTH

                      K 1 Reply Last reply
                      0
                      • D Dinesh Mani

                        From the first post, your IndexChanged event is of type (Delegate) DropDownSelectedIndexChanged. Where as you are trying to assign it to a delegate of type MyUserControlUC.SelectedIndexChanged. You should actually be assigning it to MyUserControlUC.DropDownSelectedIndexChanged.That is what the error message implies too. You have used the namespace qualifier "ASP" to assign the IndexChanged event handler. Is this namespace correct?? Try the changes, it might do the trick. HTH

                        K Offline
                        K Offline
                        K V Sekhar
                        wrote on last edited by
                        #11

                        Hi Dinesh, Thanks for your response. That was not a problem, because the application is running perfectly and the dropdown event fires and giving the results to me. No errors while building and running the WebSite. But there are bulid errors while building the DeploymentProject of above website. The errors i already posted in my above post. Thanks & Regards kv sekhar

                        1 Reply Last reply
                        0
                        • N Nath

                          Could u provide the information details whats the error or at the root itself can u specify it clealy

                          A Offline
                          A Offline
                          amitamit099
                          wrote on last edited by
                          #12

                          I am developing a mail application. Through smtp I am sending mail. I work properly. Mail will send successfully. After sending mail I am display message your mail has send successfully(which is show after the mail has been send). But the problem is that when I press F5 button then mail again send. And it is sending again and again when ever I press F5 I donot want to send mail again when pressing F5 and message will also will display after mail has been send. I tray to redirect the page it solve my problem to resend the page but in this situation massage will not display. Plz can u help me

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups