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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to access a method/variable declared in a web user control form(.ascx) from a web form(.aspx) (C#)

how to access a method/variable declared in a web user control form(.ascx) from a web form(.aspx) (C#)

Scheduled Pinned Locked Moved ASP.NET
csharptutorialquestion
4 Posts 2 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.
  • I Offline
    I Offline
    ipsoftware
    wrote on last edited by
    #1

    how to access a method/variable declared in a web user control form(.ascx) from a web form(.aspx) (C#) Suppose I have a button in .aspx file, two labels and one method in .ascx file. if I click on the button, I want to change the label text display and pass some parameters to the method to do some processing, How may i do that? I already declared the labels and methods to be public. seems declaring a instance of web user control class not working...

    I A 2 Replies Last reply
    0
    • I ipsoftware

      how to access a method/variable declared in a web user control form(.ascx) from a web form(.aspx) (C#) Suppose I have a button in .aspx file, two labels and one method in .ascx file. if I click on the button, I want to change the label text display and pass some parameters to the method to do some processing, How may i do that? I already declared the labels and methods to be public. seems declaring a instance of web user control class not working...

      I Offline
      I Offline
      ipsoftware
      wrote on last edited by
      #2

      and vice versa how to access method /variable in .aspx from a .ascx file? is that possible?

      1 Reply Last reply
      0
      • I ipsoftware

        how to access a method/variable declared in a web user control form(.ascx) from a web form(.aspx) (C#) Suppose I have a button in .aspx file, two labels and one method in .ascx file. if I click on the button, I want to change the label text display and pass some parameters to the method to do some processing, How may i do that? I already declared the labels and methods to be public. seems declaring a instance of web user control class not working...

        A Offline
        A Offline
        aplope
        wrote on last edited by
        #3

        Found this article on the web. Seems to address your problem quite adequately. http://aspalliance.com/articleViewer.aspx?aId=67&pId=-1 Pegmeister

        I 1 Reply Last reply
        0
        • A aplope

          Found this article on the web. Seems to address your problem quite adequately. http://aspalliance.com/articleViewer.aspx?aId=67&pId=-1 Pegmeister

          I Offline
          I Offline
          ipsoftware
          wrote on last edited by
          #4

          Thank you for the help!!

          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