Attributes.Add() for DataList

Discussion in 'ASP .Net Datagrid Control' started by Steve Klett, Nov 18, 2003.

  1. Steve Klett

    Steve Klett Guest

    I know this is the DataGrid forum, but there is no DataList and this is the
    closest thing. Hope that's cool.

    Basically... it appears to be impossible to add additional attributes to a
    DataList (IE: onMouseOver)
    The DataListItem.Attributes.Add() method doesn't complain, it adds the
    strings to the collection but they aren't rendered out. I wondered if
    anyone here had a work around. The DataGrid is not an acceptable workaround
    because it does not have a <SelectedItemTemplate>

    I know I can catch the selected item in the bound event, but I haven't had
    success adding a new control and binding it. So for now, the DataList is my
    boy..... kinda, just need to get some DHTML going and for that.. I need to
    add attributes.

    Any help greatly appreciated!

    Thanks,
    Steve
    Steve Klett, Nov 18, 2003
    #1
    1. Advertising

  2. Steve Klett

    Alvin Bruney Guest

    what is your argument to your add function?
    it should be attributes.add("onmouseover","script here");
    or alternatively attributes["onmouseover"] = "script here";

    regards

    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits
    "Steve Klett" <> wrote in message
    news:e##...
    > I know this is the DataGrid forum, but there is no DataList and this is

    the
    > closest thing. Hope that's cool.
    >
    > Basically... it appears to be impossible to add additional attributes to a
    > DataList (IE: onMouseOver)
    > The DataListItem.Attributes.Add() method doesn't complain, it adds the
    > strings to the collection but they aren't rendered out. I wondered if
    > anyone here had a work around. The DataGrid is not an acceptable

    workaround
    > because it does not have a <SelectedItemTemplate>
    >
    > I know I can catch the selected item in the bound event, but I haven't had
    > success adding a new control and binding it. So for now, the DataList is

    my
    > boy..... kinda, just need to get some DHTML going and for that.. I need to
    > add attributes.
    >
    > Any help greatly appreciated!
    >
    > Thanks,
    > Steve
    >
    >
    Alvin Bruney, Nov 18, 2003
    #2
    1. Advertising

  3. Steve Klett

    Steve Klett Guest

    that is correct. both of those have been tried.
    I am fine with the syntax, I have used Attributes with the datagrid w/our
    problem, it is the DataList that is the problem.

    Thanks,
    SK


    "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote in
    message news:...
    > what is your argument to your add function?
    > it should be attributes.add("onmouseover","script here");
    > or alternatively attributes["onmouseover"] = "script here";
    >
    > regards
    >
    > --
    >
    >
    > -----------
    > Got TidBits?
    > Get it here: www.networkip.net/tidbits
    > "Steve Klett" <> wrote in message
    > news:e##...
    > > I know this is the DataGrid forum, but there is no DataList and this is

    > the
    > > closest thing. Hope that's cool.
    > >
    > > Basically... it appears to be impossible to add additional attributes to

    a
    > > DataList (IE: onMouseOver)
    > > The DataListItem.Attributes.Add() method doesn't complain, it adds the
    > > strings to the collection but they aren't rendered out. I wondered if
    > > anyone here had a work around. The DataGrid is not an acceptable

    > workaround
    > > because it does not have a <SelectedItemTemplate>
    > >
    > > I know I can catch the selected item in the bound event, but I haven't

    had
    > > success adding a new control and binding it. So for now, the DataList

    is
    > my
    > > boy..... kinda, just need to get some DHTML going and for that.. I need

    to
    > > add attributes.
    > >
    > > Any help greatly appreciated!
    > >
    > > Thanks,
    > > Steve
    > >
    > >

    >
    >
    Steve Klett, Nov 18, 2003
    #3
  4. Steve Klett

    Alvin Bruney Guest

    did you figure this out or get help on it?

    --
    Regards,
    Alvin Bruney
    Got Tidbits? Get it here
    www.networkip.net/tidbits
    "Steve Klett" <> wrote in message
    news:%...
    > that is correct. both of those have been tried.
    > I am fine with the syntax, I have used Attributes with the datagrid w/our
    > problem, it is the DataList that is the problem.
    >
    > Thanks,
    > SK
    >
    >
    > "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote in
    > message news:...
    > > what is your argument to your add function?
    > > it should be attributes.add("onmouseover","script here");
    > > or alternatively attributes["onmouseover"] = "script here";
    > >
    > > regards
    > >
    > > --
    > >
    > >
    > > -----------
    > > Got TidBits?
    > > Get it here: www.networkip.net/tidbits
    > > "Steve Klett" <> wrote in message
    > > news:e##...
    > > > I know this is the DataGrid forum, but there is no DataList and this

    is
    > > the
    > > > closest thing. Hope that's cool.
    > > >
    > > > Basically... it appears to be impossible to add additional attributes

    to
    > a
    > > > DataList (IE: onMouseOver)
    > > > The DataListItem.Attributes.Add() method doesn't complain, it adds the
    > > > strings to the collection but they aren't rendered out. I wondered if
    > > > anyone here had a work around. The DataGrid is not an acceptable

    > > workaround
    > > > because it does not have a <SelectedItemTemplate>
    > > >
    > > > I know I can catch the selected item in the bound event, but I haven't

    > had
    > > > success adding a new control and binding it. So for now, the DataList

    > is
    > > my
    > > > boy..... kinda, just need to get some DHTML going and for that.. I

    need
    > to
    > > > add attributes.
    > > >
    > > > Any help greatly appreciated!
    > > >
    > > > Thanks,
    > > > Steve
    > > >
    > > >

    > >
    > >

    >
    >
    Alvin Bruney, Nov 30, 2003
    #4
  5. Steve Klett

    Steve Klett Guest

    nope, nothing yet.


    "Alvin Bruney" <> wrote in message
    news:...
    > did you figure this out or get help on it?
    >
    > --
    > Regards,
    > Alvin Bruney
    > Got Tidbits? Get it here
    > www.networkip.net/tidbits
    > "Steve Klett" <> wrote in message
    > news:%...
    > > that is correct. both of those have been tried.
    > > I am fine with the syntax, I have used Attributes with the datagrid

    w/our
    > > problem, it is the DataList that is the problem.
    > >
    > > Thanks,
    > > SK
    > >
    > >
    > > "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote

    in
    > > message news:...
    > > > what is your argument to your add function?
    > > > it should be attributes.add("onmouseover","script here");
    > > > or alternatively attributes["onmouseover"] = "script here";
    > > >
    > > > regards
    > > >
    > > > --
    > > >
    > > >
    > > > -----------
    > > > Got TidBits?
    > > > Get it here: www.networkip.net/tidbits
    > > > "Steve Klett" <> wrote in message
    > > > news:e##...
    > > > > I know this is the DataGrid forum, but there is no DataList and this

    > is
    > > > the
    > > > > closest thing. Hope that's cool.
    > > > >
    > > > > Basically... it appears to be impossible to add additional

    attributes
    > to
    > > a
    > > > > DataList (IE: onMouseOver)
    > > > > The DataListItem.Attributes.Add() method doesn't complain, it adds

    the
    > > > > strings to the collection but they aren't rendered out. I wondered

    if
    > > > > anyone here had a work around. The DataGrid is not an acceptable
    > > > workaround
    > > > > because it does not have a <SelectedItemTemplate>
    > > > >
    > > > > I know I can catch the selected item in the bound event, but I

    haven't
    > > had
    > > > > success adding a new control and binding it. So for now, the

    DataList
    > > is
    > > > my
    > > > > boy..... kinda, just need to get some DHTML going and for that.. I

    > need
    > > to
    > > > > add attributes.
    > > > >
    > > > > Any help greatly appreciated!
    > > > >
    > > > > Thanks,
    > > > > Steve
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Steve Klett, Dec 4, 2003
    #5
    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. Scott Reynolds

    datalist attributes.add

    Scott Reynolds, Aug 30, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    2,018
    Scott Reynolds
    Aug 30, 2004
  2. Nevyn Twyll
    Replies:
    8
    Views:
    1,842
  3. Max
    Replies:
    1
    Views:
    468
    Joe Kesselman
    Sep 22, 2006
  4. P4trykx
    Replies:
    2
    Views:
    1,785
    bruce barker
    Jan 31, 2007
  5. Steve Klett

    DataList and Attributes.Add()

    Steve Klett, Nov 25, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    118
    Steve Klett
    Nov 25, 2003
Loading...

Share This Page