Conditions in aspx page
-
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
-
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
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.
-
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
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 thatcheers, Abhijit Check My Latest Article
-
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.
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
-
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
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.
-
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
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
-
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