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. Conditions in aspx page

Conditions in aspx page

Scheduled Pinned Locked Moved ASP.NET
questionbusinesstutorial
7 Posts 5 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
    kjosh
    wrote on last edited by
    #1

    Hi, I have one Applications.aspx page. There are 5 types of applications. I am using the Applications.aspx to process the 5 types of applications. So For the Application type 1, I need to show some fields which are not applicable to other application types. some of the input fileds for the applicationtype 2 are not applicable to remaining application types. How to put the conditions in aspx page to show the necessary fields nased on the application type in one aspx page? What is the best solution for this type of requirements? Thanks in advance

    C A S 3 Replies Last reply
    0
    • K kjosh

      Hi, I have one Applications.aspx page. There are 5 types of applications. I am using the Applications.aspx to process the 5 types of applications. So For the Application type 1, I need to show some fields which are not applicable to other application types. some of the input fileds for the applicationtype 2 are not applicable to remaining application types. How to put the conditions in aspx page to show the necessary fields nased on the application type in one aspx page? What is the best solution for this type of requirements? Thanks in advance

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Writing code and setting the visible property of either fields, or user controls, depending on how complex the differences are.

      Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

      K 1 Reply Last reply
      0
      • K kjosh

        Hi, I have one Applications.aspx page. There are 5 types of applications. I am using the Applications.aspx to process the 5 types of applications. So For the Application type 1, I need to show some fields which are not applicable to other application types. some of the input fileds for the applicationtype 2 are not applicable to remaining application types. How to put the conditions in aspx page to show the necessary fields nased on the application type in one aspx page? What is the best solution for this type of requirements? Thanks in advance

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        you hjave to check condition for your application and based on that just show your controls. e.g protected void Page_Load(.....) { if(Condition of Application1) { //Show Controls of Application1 //Hide Control of Applicattion 2,3,4,5 } else if(Condition of Application2) { //Show Controls of Application2 //Hide Control of Applicattion 1,3,4,5 } . . } you can also Switch statement for that

        cheers, Abhijit Check My Latest Article

        1 Reply Last reply
        0
        • C Christian Graus

          Writing code and setting the visible property of either fields, or user controls, depending on how complex the differences are.

          Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

          K Offline
          K Offline
          kjosh
          wrote on last edited by
          #4

          I* have so many controls for each application type. Setting visiblity for all the controls depending on application type will result in many lines of code. Insted of this approach, can we write the condition in aspx page like <% applicationtype > controls related to this type? Thanks

          C J 2 Replies Last reply
          0
          • K kjosh

            I* have so many controls for each application type. Setting visiblity for all the controls depending on application type will result in many lines of code. Insted of this approach, can we write the condition in aspx page like <% applicationtype > controls related to this type? Thanks

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            No, I'm afraid you reach a point in life where you have to write actual code. How many lines can it take to show one of five different controls ?

            Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

            1 Reply Last reply
            0
            • K kjosh

              Hi, I have one Applications.aspx page. There are 5 types of applications. I am using the Applications.aspx to process the 5 types of applications. So For the Application type 1, I need to show some fields which are not applicable to other application types. some of the input fileds for the applicationtype 2 are not applicable to remaining application types. How to put the conditions in aspx page to show the necessary fields nased on the application type in one aspx page? What is the best solution for this type of requirements? Thanks in advance

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

              Another way is to create different user controls for different applications types And load one og these user controls at run time depending on our business logic

              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... " Check My Blog

              1 Reply Last reply
              0
              • K kjosh

                I* have so many controls for each application type. Setting visiblity for all the controls depending on application type will result in many lines of code. Insted of this approach, can we write the condition in aspx page like <% applicationtype > controls related to this type? Thanks

                J Offline
                J Offline
                J4amieC
                wrote on last edited by
                #7

                Put the controls in a PlaceHolder and show/hide the one placeholder depending on condition.

                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