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. General Programming
  3. C#
  4. calling user control in test.aspx.cs

calling user control in test.aspx.cs

Scheduled Pinned Locked Moved C#
tutorial
6 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.
  • F Offline
    F Offline
    Farhan Ali
    wrote on last edited by
    #1

    AOA: I have made a user control now i want to call that user control in my test.aspx.cs file . can anybody knows how to call this. Regards Farhan Ali

    S 1 Reply Last reply
    0
    • F Farhan Ali

      AOA: I have made a user control now i want to call that user control in my test.aspx.cs file . can anybody knows how to call this. Regards Farhan Ali

      S Offline
      S Offline
      Sandeep Akhare
      wrote on last edited by
      #2

      First Register that control in your aspx page <%@ Register tagprefix="tagprefix" namespace="namespace" assembly="assembly" %> Then use it in your aspx page IN Code behind (.cs) file use this id Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

      F 1 Reply Last reply
      0
      • S Sandeep Akhare

        First Register that control in your aspx page <%@ Register tagprefix="tagprefix" namespace="namespace" assembly="assembly" %> Then use it in your aspx page IN Code behind (.cs) file use this id Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

        F Offline
        F Offline
        Farhan Ali
        wrote on last edited by
        #3

        i have done it like this but when in .cs file i use this id no attributes of that user control comes. Am i missing something Thanx

        S 1 Reply Last reply
        0
        • F Farhan Ali

          i have done it like this but when in .cs file i use this id no attributes of that user control comes. Am i missing something Thanx

          S Offline
          S Offline
          Sandeep Akhare
          wrote on last edited by
          #4

          Are you able too see that user control When you run the application ? Might be IDE problem if evry thing is right ? Can you post the code ?

          Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

          F 1 Reply Last reply
          0
          • S Sandeep Akhare

            Are you able too see that user control When you run the application ? Might be IDE problem if evry thing is right ? Can you post the code ?

            Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

            F Offline
            F Offline
            Farhan Ali
            wrote on last edited by
            #5

            UserControl usc = (SuitableProd)Master.FindControl("SuitableProd"); if (usc != null) { usc. (here i want other controls which are contained by the user control) }

            S 1 Reply Last reply
            0
            • F Farhan Ali

              UserControl usc = (SuitableProd)Master.FindControl("SuitableProd"); if (usc != null) { usc. (here i want other controls which are contained by the user control) }

              S Offline
              S Offline
              Sandeep Akhare
              wrote on last edited by
              #6

              TRY THIS SuitableProd usc = (SuitableProd)Master.FindControl("SuitableProd");

              Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

              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