Dropdownlist and OnMouseover Event using Ajax

Discussion in 'ASP .Net' started by =?Utf-8?B?RGVlcGE=?=, Mar 31, 2007.

  1. Hi All,

    I have a webform in asp.net framework 1.1 where the dropdownlist is
    populated with list of locations from the database. The depending on the list
    selected, the user will be able to see functions associated for that location.

    Ex: Location: Charleston
    Functions: Add, Delete, Cancel, Edit

    Location: Los Angeles
    Functions: Activate, Cancel

    The functions will be displayed in a Repeater control in the right corner of
    the page.
    I was able to use OnChange of this dropdownlist to show the list of
    functions. But, I would like to use OnMouseover of the list of items in the
    dropdownlist to show the functions. The list has to change everytime the user
    does a mouseover on the location. How can I accomplish this?

    Here is my code:

    <asp:DropDownList id="LocationsGroups" tabIndex="16" runat="server"
    cssclass="body-small" width="100%"></asp:DropDownList>

    <asp:repeater id="GrpLocFunctions" runat="server">
    <ItemTemplate>
    <tbody>
    <tr class="regular-row">
    <td width="100%"><%# DataBinder.Eval(Container.DataItem, "FUNCTION") %>
    </td>
    </tr>
    </ItemTemplate>
    <AlternatingItemTemplate>
    <tr class="alternate-row">
    <td width="100%"><%# DataBinder.Eval(Container.DataItem, "FUNCTION") %>
    </td>
    </tr>
    </AlternatingItemTemplate>
    <FooterTemplate>
    </tbody>
    </table>
    </FooterTemplate>
    </asp:repeater>

    AJAX code:

    function filterFuncs() {
    var gl = document.getElementById('LocationsGroups').options.value;
    SunCom.UsersAgentAdmin.UserMaint.FilterGroupLocationFunctions(gl,
    filterFuncs_CallBack);

    }

    function filterFuncs_CallBack(res) {
    if(res.error == null) {
    document.getElementById('GroupLocationFunctions').innerHTML =
    res.value;
    }
    }

    The code behind calls this

    LocationsGroups.Attributes.Add("OnChange", "filterFuncs();")

    I tried to change the OnChange to OnMouseOver. It didnot work.

    Appreciate some help.

    Thanks.
     
    =?Utf-8?B?RGVlcGE=?=, Mar 31, 2007
    #1
    1. Advertising

  2. =?Utf-8?B?RGVlcGE=?=

    Ben Rush Guest

    Hi Deepa,

    IE doesn't seem to support onmouseover on the option tag, which is I *think*
    what you're getting at (ie, when someone mouses over an item in the opened
    drop-down menu you can detect that through an event and, in your case,
    update something on the page). It appears as though some browsers support
    this, but IE does not (see the "Applies to" section at the bottom of this
    page):

    http://msdn.microsoft.com/library/d...author/dhtml/reference/events/onmouseover.asp

    --
    ~~~~~~~~~~~
    Ben Rush
    http://www.ben-rush.net/blog


    "Deepa" <> wrote in message
    news:...
    > Hi All,
    >
    > I have a webform in asp.net framework 1.1 where the dropdownlist is
    > populated with list of locations from the database. The depending on the
    > list
    > selected, the user will be able to see functions associated for that
    > location.
    >
    > Ex: Location: Charleston
    > Functions: Add, Delete, Cancel, Edit
    >
    > Location: Los Angeles
    > Functions: Activate, Cancel
    >
    > The functions will be displayed in a Repeater control in the right corner
    > of
    > the page.
    > I was able to use OnChange of this dropdownlist to show the list of
    > functions. But, I would like to use OnMouseover of the list of items in
    > the
    > dropdownlist to show the functions. The list has to change everytime the
    > user
    > does a mouseover on the location. How can I accomplish this?
    >
    > Here is my code:
    >
    > <asp:DropDownList id="LocationsGroups" tabIndex="16" runat="server"
    > cssclass="body-small" width="100%"></asp:DropDownList>
    >
    > <asp:repeater id="GrpLocFunctions" runat="server">
    > <ItemTemplate>
    > <tbody>
    > <tr class="regular-row">
    > <td width="100%"><%# DataBinder.Eval(Container.DataItem, "FUNCTION") %>
    > </td>
    > </tr>
    > </ItemTemplate>
    > <AlternatingItemTemplate>
    > <tr class="alternate-row">
    > <td width="100%"><%# DataBinder.Eval(Container.DataItem, "FUNCTION") %>
    > </td>
    > </tr>
    > </AlternatingItemTemplate>
    > <FooterTemplate>
    > </tbody>
    > </table>
    > </FooterTemplate>
    > </asp:repeater>
    >
    > AJAX code:
    >
    > function filterFuncs() {
    > var gl = document.getElementById('LocationsGroups').options.value;
    > SunCom.UsersAgentAdmin.UserMaint.FilterGroupLocationFunctions(gl,
    > filterFuncs_CallBack);
    >
    > }
    >
    > function filterFuncs_CallBack(res) {
    > if(res.error == null) {
    > document.getElementById('GroupLocationFunctions').innerHTML =
    > res.value;
    > }
    > }
    >
    > The code behind calls this
    >
    > LocationsGroups.Attributes.Add("OnChange", "filterFuncs();")
    >
    > I tried to change the OnChange to OnMouseOver. It didnot work.
    >
    > Appreciate some help.
    >
    > Thanks.
    >
     
    Ben Rush, Apr 1, 2007
    #2
    1. Advertising

  3. Hi Ben,

    Thanks for the info.

    Is there any other way to accomplish this?

    Deepa

    "Ben Rush" wrote:

    > Hi Deepa,
    >
    > IE doesn't seem to support onmouseover on the option tag, which is I *think*
    > what you're getting at (ie, when someone mouses over an item in the opened
    > drop-down menu you can detect that through an event and, in your case,
    > update something on the page). It appears as though some browsers support
    > this, but IE does not (see the "Applies to" section at the bottom of this
    > page):
    >
    > http://msdn.microsoft.com/library/d...author/dhtml/reference/events/onmouseover.asp
    >
    > --
    > ~~~~~~~~~~~
    > Ben Rush
    > http://www.ben-rush.net/blog
    >
    >
    > "Deepa" <> wrote in message
    > news:...
    > > Hi All,
    > >
    > > I have a webform in asp.net framework 1.1 where the dropdownlist is
    > > populated with list of locations from the database. The depending on the
    > > list
    > > selected, the user will be able to see functions associated for that
    > > location.
    > >
    > > Ex: Location: Charleston
    > > Functions: Add, Delete, Cancel, Edit
    > >
    > > Location: Los Angeles
    > > Functions: Activate, Cancel
    > >
    > > The functions will be displayed in a Repeater control in the right corner
    > > of
    > > the page.
    > > I was able to use OnChange of this dropdownlist to show the list of
    > > functions. But, I would like to use OnMouseover of the list of items in
    > > the
    > > dropdownlist to show the functions. The list has to change everytime the
    > > user
    > > does a mouseover on the location. How can I accomplish this?
    > >
    > > Here is my code:
    > >
    > > <asp:DropDownList id="LocationsGroups" tabIndex="16" runat="server"
    > > cssclass="body-small" width="100%"></asp:DropDownList>
    > >
    > > <asp:repeater id="GrpLocFunctions" runat="server">
    > > <ItemTemplate>
    > > <tbody>
    > > <tr class="regular-row">
    > > <td width="100%"><%# DataBinder.Eval(Container.DataItem, "FUNCTION") %>
    > > </td>
    > > </tr>
    > > </ItemTemplate>
    > > <AlternatingItemTemplate>
    > > <tr class="alternate-row">
    > > <td width="100%"><%# DataBinder.Eval(Container.DataItem, "FUNCTION") %>
    > > </td>
    > > </tr>
    > > </AlternatingItemTemplate>
    > > <FooterTemplate>
    > > </tbody>
    > > </table>
    > > </FooterTemplate>
    > > </asp:repeater>
    > >
    > > AJAX code:
    > >
    > > function filterFuncs() {
    > > var gl = document.getElementById('LocationsGroups').options.value;
    > > SunCom.UsersAgentAdmin.UserMaint.FilterGroupLocationFunctions(gl,
    > > filterFuncs_CallBack);
    > >
    > > }
    > >
    > > function filterFuncs_CallBack(res) {
    > > if(res.error == null) {
    > > document.getElementById('GroupLocationFunctions').innerHTML =
    > > res.value;
    > > }
    > > }
    > >
    > > The code behind calls this
    > >
    > > LocationsGroups.Attributes.Add("OnChange", "filterFuncs();")
    > >
    > > I tried to change the OnChange to OnMouseOver. It didnot work.
    > >
    > > Appreciate some help.
    > >
    > > Thanks.
    > >

    >
    >
    >
     
    =?Utf-8?B?RGVlcGE=?=, Apr 1, 2007
    #3
  4. =?Utf-8?B?RGVlcGE=?=

    Ben Rush Guest

    You may want to start looking at other control developers and see if someone
    has implemented anything that will allow you to do this. Perhaps Telerik
    (http://www.telerik.com); I've used them before and am a big fan. I'm
    unaware as to whether they have anything for you.

    You can maybe look to another option for displaying the locations (in lieu
    of using a dropdown list). Perhaps just a scrollable DIV tag in the browser,
    etc.

    --
    ~~~~~~~~~~~
    Ben Rush
    http://www.ben-rush.net/blog


    "Deepa" <> wrote in message
    news:...
    > Hi Ben,
    >
    > Thanks for the info.
    >
    > Is there any other way to accomplish this?
    >
    > Deepa
    >
    > "Ben Rush" wrote:
    >
    >> Hi Deepa,
    >>
    >> IE doesn't seem to support onmouseover on the option tag, which is I
    >> *think*
    >> what you're getting at (ie, when someone mouses over an item in the
    >> opened
    >> drop-down menu you can detect that through an event and, in your case,
    >> update something on the page). It appears as though some browsers support
    >> this, but IE does not (see the "Applies to" section at the bottom of this
    >> page):
    >>
    >> http://msdn.microsoft.com/library/d...author/dhtml/reference/events/onmouseover.asp
    >>
    >> --
    >> ~~~~~~~~~~~
    >> Ben Rush
    >> http://www.ben-rush.net/blog
    >>
    >>
    >> "Deepa" <> wrote in message
    >> news:...
    >> > Hi All,
    >> >
    >> > I have a webform in asp.net framework 1.1 where the dropdownlist is
    >> > populated with list of locations from the database. The depending on
    >> > the
    >> > list
    >> > selected, the user will be able to see functions associated for that
    >> > location.
    >> >
    >> > Ex: Location: Charleston
    >> > Functions: Add, Delete, Cancel, Edit
    >> >
    >> > Location: Los Angeles
    >> > Functions: Activate, Cancel
    >> >
    >> > The functions will be displayed in a Repeater control in the right
    >> > corner
    >> > of
    >> > the page.
    >> > I was able to use OnChange of this dropdownlist to show the list of
    >> > functions. But, I would like to use OnMouseover of the list of items in
    >> > the
    >> > dropdownlist to show the functions. The list has to change everytime
    >> > the
    >> > user
    >> > does a mouseover on the location. How can I accomplish this?
    >> >
    >> > Here is my code:
    >> >
    >> > <asp:DropDownList id="LocationsGroups" tabIndex="16" runat="server"
    >> > cssclass="body-small" width="100%"></asp:DropDownList>
    >> >
    >> > <asp:repeater id="GrpLocFunctions" runat="server">
    >> > <ItemTemplate>
    >> > <tbody>
    >> > <tr class="regular-row">
    >> > <td width="100%"><%# DataBinder.Eval(Container.DataItem, "FUNCTION") %>
    >> > </td>
    >> > </tr>
    >> > </ItemTemplate>
    >> > <AlternatingItemTemplate>
    >> > <tr class="alternate-row">
    >> > <td width="100%"><%# DataBinder.Eval(Container.DataItem, "FUNCTION") %>
    >> > </td>
    >> > </tr>
    >> > </AlternatingItemTemplate>
    >> > <FooterTemplate>
    >> > </tbody>
    >> > </table>
    >> > </FooterTemplate>
    >> > </asp:repeater>
    >> >
    >> > AJAX code:
    >> >
    >> > function filterFuncs() {
    >> > var gl = document.getElementById('LocationsGroups').options.value;
    >> > SunCom.UsersAgentAdmin.UserMaint.FilterGroupLocationFunctions(gl,
    >> > filterFuncs_CallBack);
    >> >
    >> > }
    >> >
    >> > function filterFuncs_CallBack(res) {
    >> > if(res.error == null) {
    >> > document.getElementById('GroupLocationFunctions').innerHTML =
    >> > res.value;
    >> > }
    >> > }
    >> >
    >> > The code behind calls this
    >> >
    >> > LocationsGroups.Attributes.Add("OnChange", "filterFuncs();")
    >> >
    >> > I tried to change the OnChange to OnMouseOver. It didnot work.
    >> >
    >> > Appreciate some help.
    >> >
    >> > Thanks.
    >> >

    >>
    >>
    >>
     
    Ben Rush, Apr 1, 2007
    #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. minnie
    Replies:
    1
    Views:
    757
    Andrew Thompson
    Dec 13, 2006
  2. BP
    Replies:
    1
    Views:
    829
    Benedictum
    May 2, 2007
  3. =?Utf-8?B?VG9u?=
    Replies:
    2
    Views:
    569
    =?Utf-8?B?VG9u?=
    Jun 22, 2007
  4. Samir

    onmouseover and onmouseout event

    Samir, Nov 3, 2004, in forum: Javascript
    Replies:
    7
    Views:
    211
    Zifud
    Nov 5, 2004
  5. JJA
    Replies:
    0
    Views:
    176
Loading...

Share This Page