Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > what is best approach doing this?

Reply
Thread Tools

what is best approach doing this?

 
 
Jeff
Guest
Posts: n/a
 
      10-14-2006
Hey

ASP.NET 2.0

I'm about to create a UserControl for my web project, but I'm wondering if I
need to create 2 UserControls instead. Because these UserControls will be
very similar, the only difference between them will be that one of these
UserControls are containing a control (also being a UserControl, lets call
it "A"), which the other UserControl don't contain!

So I thought about creating 2 different UserControls... but I guess this
would be bad, because these 2 UserControls will have the same markup, except
one the UserControls have a control ("A", mention above) which the other
userControl don't have

Or I could instead create only 1 UserControl, have have some logic in it
which hide or show the control ("A"). In this way I could use only
UserControl and use some kind of logic to hide or show this extra control
("A")... I guess this approach is the best, but would like to know your
thought about this too?

Best Regards

Jeff


 
Reply With Quote
 
 
 
 
Siva M
Guest
Posts: n/a
 
      10-14-2006
I prefer the second approach because it is easy to make changes later at one
place instead of two.

"Jeff" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
Hey

ASP.NET 2.0

I'm about to create a UserControl for my web project, but I'm wondering if I
need to create 2 UserControls instead. Because these UserControls will be
very similar, the only difference between them will be that one of these
UserControls are containing a control (also being a UserControl, lets call
it "A"), which the other UserControl don't contain!

So I thought about creating 2 different UserControls... but I guess this
would be bad, because these 2 UserControls will have the same markup, except
one the UserControls have a control ("A", mention above) which the other
userControl don't have

Or I could instead create only 1 UserControl, have have some logic in it
which hide or show the control ("A"). In this way I could use only
UserControl and use some kind of logic to hide or show this extra control
("A")... I guess this approach is the best, but would like to know your
thought about this too?

Best Regards

Jeff


 
Reply With Quote
 
 
 
 
Jeff
Guest
Posts: n/a
 
      10-14-2006
I agree on that but if I hide the control, will the UserControl display
still reserve space for the hided control?

In other words this control I want to hide/show is (400 pixels height and
witdth=100%) placed at the top of the UserControl. If this control is hidden
will the UserControl still reserve space (400 pixels height and witdth=100%)
for the hidden control??....

and in what event should I hide/show the control?

Jeff


"Siva M" <(E-Mail Removed)> wrote in message
news:ORHQ%(E-Mail Removed)...
>I prefer the second approach because it is easy to make changes later at
>one
> place instead of two.
>
> "Jeff" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> Hey
>
> ASP.NET 2.0
>
> I'm about to create a UserControl for my web project, but I'm wondering if
> I
> need to create 2 UserControls instead. Because these UserControls will be
> very similar, the only difference between them will be that one of these
> UserControls are containing a control (also being a UserControl, lets call
> it "A"), which the other UserControl don't contain!
>
> So I thought about creating 2 different UserControls... but I guess this
> would be bad, because these 2 UserControls will have the same markup,
> except
> one the UserControls have a control ("A", mention above) which the other
> userControl don't have
>
> Or I could instead create only 1 UserControl, have have some logic in it
> which hide or show the control ("A"). In this way I could use only
> UserControl and use some kind of logic to hide or show this extra control
> ("A")... I guess this approach is the best, but would like to know your
> thought about this too?
>
> Best Regards
>
> Jeff
>
>



 
Reply With Quote
 
Siva M
Guest
Posts: n/a
 
      10-14-2006
Set the Visible property to False. This wil not generate any markup nor will
it occupy any space on the browser.

Page Load event may be used to show/hide the control.

"Jeff" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
I agree on that but if I hide the control, will the UserControl display
still reserve space for the hided control?

In other words this control I want to hide/show is (400 pixels height and
witdth=100%) placed at the top of the UserControl. If this control is hidden
will the UserControl still reserve space (400 pixels height and witdth=100%)
for the hidden control??....

and in what event should I hide/show the control?

Jeff


"Siva M" <(E-Mail Removed)> wrote in message
news:ORHQ%(E-Mail Removed)...
>I prefer the second approach because it is easy to make changes later at
>one
> place instead of two.
>
> "Jeff" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> Hey
>
> ASP.NET 2.0
>
> I'm about to create a UserControl for my web project, but I'm wondering if
> I
> need to create 2 UserControls instead. Because these UserControls will be
> very similar, the only difference between them will be that one of these
> UserControls are containing a control (also being a UserControl, lets call
> it "A"), which the other UserControl don't contain!
>
> So I thought about creating 2 different UserControls... but I guess this
> would be bad, because these 2 UserControls will have the same markup,
> except
> one the UserControls have a control ("A", mention above) which the other
> userControl don't have
>
> Or I could instead create only 1 UserControl, have have some logic in it
> which hide or show the control ("A"). In this way I could use only
> UserControl and use some kind of logic to hide or show this extra control
> ("A")... I guess this approach is the best, but would like to know your
> thought about this too?
>
> Best Regards
>
> Jeff
>
>



 
Reply With Quote
 
Jeff
Guest
Posts: n/a
 
      10-14-2006
Thanks!



"Siva M" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Set the Visible property to False. This wil not generate any markup nor
> will
> it occupy any space on the browser.
>
> Page Load event may be used to show/hide the control.
>
> "Jeff" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> I agree on that but if I hide the control, will the UserControl display
> still reserve space for the hided control?
>
> In other words this control I want to hide/show is (400 pixels height and
> witdth=100%) placed at the top of the UserControl. If this control is
> hidden
> will the UserControl still reserve space (400 pixels height and
> witdth=100%)
> for the hidden control??....
>
> and in what event should I hide/show the control?
>
> Jeff
>
>
> "Siva M" <(E-Mail Removed)> wrote in message
> news:ORHQ%(E-Mail Removed)...
>>I prefer the second approach because it is easy to make changes later at
>>one
>> place instead of two.
>>
>> "Jeff" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> Hey
>>
>> ASP.NET 2.0
>>
>> I'm about to create a UserControl for my web project, but I'm wondering
>> if
>> I
>> need to create 2 UserControls instead. Because these UserControls will be
>> very similar, the only difference between them will be that one of these
>> UserControls are containing a control (also being a UserControl, lets
>> call
>> it "A"), which the other UserControl don't contain!
>>
>> So I thought about creating 2 different UserControls... but I guess this
>> would be bad, because these 2 UserControls will have the same markup,
>> except
>> one the UserControls have a control ("A", mention above) which the other
>> userControl don't have
>>
>> Or I could instead create only 1 UserControl, have have some logic in it
>> which hide or show the control ("A"). In this way I could use only
>> UserControl and use some kind of logic to hide or show this extra control
>> ("A")... I guess this approach is the best, but would like to know your
>> thought about this too?
>>
>> Best Regards
>>
>> Jeff
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Core Exams - Best approach to take? =?Utf-8?B?R2F2aW4=?= MCSE 1 02-02-2006 03:29 PM
Best Approach? Conditionally checking a CheckBoxList item if record is found.. D. Shane Fowlkes ASP .Net 0 05-11-2004 07:40 PM
Multithreading Async aspx best approach milesm ASP .Net 1 05-06-2004 12:24 AM
Help - Best approach using Shared Classes ? Paul ASP .Net 3 04-30-2004 07:00 PM
Best approach to bind data from XML to an asp:Table Greg Linwood ASP .Net 4 12-03-2003 05:44 PM



Advertisments