UserControl....
-
hii, I am having one user control containing grid.where should i write the code for that grid...in that user control or in the web page..? Jijo kuruvila software developer trivandrum
-
hii, I am having one user control containing grid.where should i write the code for that grid...in that user control or in the web page..? Jijo kuruvila software developer trivandrum
hi, john kuruvila wrote: .where should i write the code for that grid...in that user control or in the web page..? When you choosed to include grid as a part of user control, so I guess it logically belongs to that control. So, from OOP, you shouldn't directly expose that grid to others => you shouldn't write code for grid in the page. It probably should be internal thing for your control. Sometimes (when you are sure you know what you are doing), it's good to have direct access to members, that's why
internal
modifier is here (allows access to this member from same assembly). Say, you have Calendar control, you don't want (control's) user to insert letters instead of numbers, right? By writing checks in public methods, you assure yourself that input will be allways correct, and control's data will be consistent. So, answer is: write code for grid in user control :-D Do you know what I mean? best regards, David 'DNH' Nohejl Never forget: "Stay kul and happy" (I.A.) -
hi, john kuruvila wrote: .where should i write the code for that grid...in that user control or in the web page..? When you choosed to include grid as a part of user control, so I guess it logically belongs to that control. So, from OOP, you shouldn't directly expose that grid to others => you shouldn't write code for grid in the page. It probably should be internal thing for your control. Sometimes (when you are sure you know what you are doing), it's good to have direct access to members, that's why
internal
modifier is here (allows access to this member from same assembly). Say, you have Calendar control, you don't want (control's) user to insert letters instead of numbers, right? By writing checks in public methods, you assure yourself that input will be allways correct, and control's data will be consistent. So, answer is: write code for grid in user control :-D Do you know what I mean? best regards, David 'DNH' Nohejl Never forget: "Stay kul and happy" (I.A.)hii dnh, Thank You...:-D Jijo kuruvila software developer trivandrum