webparts (VB.NET)

Discussion in 'ASP .Net' started by ton, Mar 31, 2010.

  1. ton

    ton Guest

    Hi,

    I want to use webparts. I'm develoing a control to use as webpart but I want
    to let users customize some properties of the webpart. How can this be done
    in VB. I've allready added a asp:propertygird conmtrol to the editor zone,
    but what next?

    How can I set the properties? (In the usercontrol I just created)

    Isn't there a standerd tamplate which can be added as a new Item?

    Thanx


    Ton
    ton, Mar 31, 2010
    #1
    1. Advertising

  2. "ton" <> wrote in message
    news:86b5$4bb35d2e$541ee3ce$1.nb.home.nl...
    > Hi,
    >
    > I want to use webparts. I'm develoing a control to use as webpart but I
    > want to let users customize some properties of the webpart. How can this
    > be done in VB. I've allready added a asp:propertygird conmtrol to the
    > editor zone, but what next?
    >
    > How can I set the properties? (In the usercontrol I just created)


    Do you mean setting properties prior to render or as the application is
    running? If you truly mean properties, like in a class, this might help:

    http://msdn.microsoft.com/en-us/library/dd584174(office.11).aspx

    If you are talking client side only, run time behavior, it gets trickier, of
    course and there are two basic avenues of attack, depending on what you are
    doing. They are JavaScript and CSS.

    --
    Peace and Grace,
    Greg

    Twitter: @gbworld
    Blog: http://gregorybeamer.spaces.live.com

    ************************************************
    | Think outside the box! |
    ************************************************
    Gregory A. Beamer, Mar 31, 2010
    #2
    1. Advertising

  3. ton

    ton Guest

    Re: webparts (VB.NET) Next step ......

    Thanx ! It worked, I'm allmost there:

    <CategoryAttribute("Application"), _
    DefaultValueAttribute("Titel"), _
    WebParts.WebBrowsable(True), _
    WebParts.Personalizable(PersonalizationScope.User), _
    WebDisplayName("geef titel")> _
    Public Property Titel() As String
    Get
    Return _title
    End Get
    Set(ByVal Value As String)
    _title = Value
    End Set
    End Property

    Now I have to see a dropdownlist where the list is based upon a query from a
    sql database. The user has to choose 1 item and this value should be stored
    in the webpart. The example above worked because the value is stored and
    after a new visit the stored value is taken. So far so good.....

    Thanx

    Ton




    "Gregory A. Beamer" <> schreef in bericht
    news:...
    >
    >
    > "ton" <> wrote in message
    > news:86b5$4bb35d2e$541ee3ce$1.nb.home.nl...
    >> Hi,
    >>
    >> I want to use webparts. I'm develoing a control to use as webpart but I
    >> want to let users customize some properties of the webpart. How can this
    >> be done in VB. I've allready added a asp:propertygird conmtrol to the
    >> editor zone, but what next?
    >>
    >> How can I set the properties? (In the usercontrol I just created)

    >
    > Do you mean setting properties prior to render or as the application is
    > running? If you truly mean properties, like in a class, this might help:
    >
    > http://msdn.microsoft.com/en-us/library/dd584174(office.11).aspx
    >
    > If you are talking client side only, run time behavior, it gets trickier,
    > of course and there are two basic avenues of attack, depending on what you
    > are doing. They are JavaScript and CSS.
    >
    > --
    > Peace and Grace,
    > Greg
    >
    > Twitter: @gbworld
    > Blog: http://gregorybeamer.spaces.live.com
    >
    > ************************************************
    > | Think outside the box! |
    > ************************************************
    ton, Mar 31, 2010
    #3
  4. ton

    ton Guest

    Re: webparts (VB.NET) Next step ......

    I think I've solved this problem

    I add a dropdownlist to the usercontrol.
    I let the user pick one from a list
    and save the value in the database with: control.parent.clientid as a key
    this is different for any webpart which uses this usercontrol.

    User do not have to use the webpart Edit mode to modify the choosen value.





    "ton" <> schreef in bericht
    news:15d37$4bb38ac0$541ee3ce$1.nb.home.nl...
    > Thanx ! It worked, I'm allmost there:
    >
    > <CategoryAttribute("Application"), _
    > DefaultValueAttribute("Titel"), _
    > WebParts.WebBrowsable(True), _
    > WebParts.Personalizable(PersonalizationScope.User), _
    > WebDisplayName("geef titel")> _
    > Public Property Titel() As String
    > Get
    > Return _title
    > End Get
    > Set(ByVal Value As String)
    > _title = Value
    > End Set
    > End Property
    >
    > Now I have to see a dropdownlist where the list is based upon a query from
    > a sql database. The user has to choose 1 item and this value should be
    > stored in the webpart. The example above worked because the value is
    > stored and after a new visit the stored value is taken. So far so
    > good.....
    >
    > Thanx
    >
    > Ton
    >
    >
    >
    >
    > "Gregory A. Beamer" <> schreef in bericht
    > news:...
    >>
    >>
    >> "ton" <> wrote in message
    >> news:86b5$4bb35d2e$541ee3ce$1.nb.home.nl...
    >>> Hi,
    >>>
    >>> I want to use webparts. I'm develoing a control to use as webpart but I
    >>> want to let users customize some properties of the webpart. How can this
    >>> be done in VB. I've allready added a asp:propertygird conmtrol to the
    >>> editor zone, but what next?
    >>>
    >>> How can I set the properties? (In the usercontrol I just created)

    >>
    >> Do you mean setting properties prior to render or as the application is
    >> running? If you truly mean properties, like in a class, this might help:
    >>
    >> http://msdn.microsoft.com/en-us/library/dd584174(office.11).aspx
    >>
    >> If you are talking client side only, run time behavior, it gets trickier,
    >> of course and there are two basic avenues of attack, depending on what
    >> you are doing. They are JavaScript and CSS.
    >>
    >> --
    >> Peace and Grace,
    >> Greg
    >>
    >> Twitter: @gbworld
    >> Blog: http://gregorybeamer.spaces.live.com
    >>
    >> ************************************************
    >> | Think outside the box! |
    >> ************************************************

    >
    ton, Apr 1, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VB Programmer

    Webparts - in asp.net 1.1?

    VB Programmer, Oct 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,340
    chanmmn
    Oct 23, 2004
  2. ALI-R

    ASP.Net Framework2 and webparts

    ALI-R, Mar 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    388
    Brock Allen
    Mar 16, 2005
  3. =?Utf-8?B?Q2hyaXN0b3BoZXIgS2ltYmVsbA==?=

    Theming custom created WebParts in ASP.NET 2.0

    =?Utf-8?B?Q2hyaXN0b3BoZXIgS2ltYmVsbA==?=, Jun 24, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    3,290
    Steven Cheng[MSFT]
    Jun 30, 2005
  4. Michael
    Replies:
    0
    Views:
    346
    Michael
    Dec 6, 2005
  5. Sahil Malik [MVP C#]

    Questions about ASP.NET 2.0 Webparts

    Sahil Malik [MVP C#], Mar 8, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    396
    Sahil Malik [MVP C#]
    Mar 8, 2006
Loading...

Share This Page