Very Simple Web Part Question - Help

Last post 03-17-2006 12:24 PM by davidbarkol. 7 replies.

Sort Posts:

  • Very Simple Web Part Question - Help

    03-16-2006, 3:10 PM
    • Member
      100 point Member
    • jf1
    • Member since 12-04-2005, 2:34 AM
    • Posts 20
    Ok I have taken the plunge and attempted to start working with web parts.

    What I want to display on the web page is a list of names with a 'down' arrow button next to each as so:

    Dr. Mike Stevens \/

    Dr. Kelly carter \/

    When you click a down arrow button, the person's image, bio, etc appear under the name.

    So, here is what I have done in VS 2005..

    1. Dragged and dropped a WebPartManager to the top of the page.
    2. Dragged and dropped the first web zone for Dr Stevens.
    3. Created the first user control  (i.e. drstevens.ascx) that contains his bio, image, etc
    4. Dragged and dropped the user control into the first web zone

    When I go to view this page in the browser, the user contol content is present and so forth, but there is now down arrow to expand collapse the user control under his name.

    So again, the question is: how do I set this up so by default each web zone with the person's name appears down the page and by default the user controls in them are collapsed and expandable by simply clicking the down arrow button next to their name?

    Am I even going about this the right way?

    Thank you
  • Re: Very Simple Web Part Question - Help

    03-16-2006, 4:23 PM
    • Member
      100 point Member
    • jf1
    • Member since 12-04-2005, 2:34 AM
    • Posts 20
    I should also state that I am unable to get the down arrow to appear at run time. I have web.config set up to allow all users.
  • Re: Very Simple Web Part Question - Help

    03-16-2006, 6:40 PM
    • Member
      720 point Member
    • davidbarkol
    • Member since 01-27-2006, 1:57 PM
    • CA
    • Posts 141
    • ASPInsiders

    It sounds like you might be going down the wrong path. But let me understand first what you are trying to do...

    You want to have a web part that hides and shows content about a person/doctor. If this is correct, then the implementation details are in the user control, not the web part. The web part is just a container for the interface.

    You need to add code and logic to your usercontrol that hides and shows the doctors information. You can do this with a link that hides and shows a 'div' area on control.

    Does this make sense? I am correct in my assumptions on what you are trying to accomplish?

  • Re: Very Simple Web Part Question - Help

    03-16-2006, 9:33 PM
    • Member
      100 point Member
    • jf1
    • Member since 12-04-2005, 2:34 AM
    • Posts 20
    OK. I gotchya. So really, I'm not using web parts as they are intended - and that is for interface elements.

    So if I'm following you, you're implying web parts aren't the right tool for this particular job. That i should instead use perhaps js and javascript to show/hide a layer?

    Thanks
  • Re: Very Simple Web Part Question - Help

    03-16-2006, 9:34 PM
    • Member
      100 point Member
    • jf1
    • Member since 12-04-2005, 2:34 AM
    • Posts 20
    Also, is there any aspect of .net 2.0 that can be used for what I'm trying to do? What about an asp panel? How would that work?
  • Re: Very Simple Web Part Question - Help

    03-17-2006, 1:16 AM
    • Member
      720 point Member
    • davidbarkol
    • Member since 01-27-2006, 1:57 PM
    • CA
    • Posts 141
    • ASPInsiders

    You can use javascript to show and hide an area, the advantageous to that is you eliminate a postback.

    A server side solution would be to use a panel like you suggested. You can set the panel's visible property to true or false but you will have a postback.

     

     

  • Re: Very Simple Web Part Question - Help

    03-17-2006, 3:31 AM
    • Member
      100 point Member
    • jf1
    • Member since 12-04-2005, 2:34 AM
    • Posts 20
    Ok fair enough.. but what about visitors that don't have javascript enabled? they'd miss the whole experience.

    So the only disadvantage of a postback is the overhead caused by the postback? Is that what you're saying?

  • Re: Very Simple Web Part Question - Help

    03-17-2006, 12:24 PM
    • Member
      720 point Member
    • davidbarkol
    • Member since 01-27-2006, 1:57 PM
    • CA
    • Posts 141
    • ASPInsiders

    You are correct. Most users do have javascript enabled though. It all depends on your target audience.

Page 1 of 1 (8 items)