Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Javascript
i am having a dropdownlist which populates some data
 
if i mouseover on any list items i have to fire one javascript function and replace the label value (only onmouseover not onchange,onclick) cracking for 2 days
 
i am using asp.net 1.1
 
any help
 
will be greatly appreciated
Posted 5-Feb-13 2:27am
Comments
Krunal Rohit at 5-Feb-13 8:32am
   
Let us know what you've cracked so far !
ryanb31 at 5-Feb-13 8:43am
   
asp.net 1.1? Are you sure?
Have you searched for the onmouseover event for a dropdown? Where are you stuck?
JemiM at 5-Feb-13 9:00am
   
which label value you want to replace?selected item value?
Gittu Dash at 5-Feb-13 11:50am
   
Well share your code what you have used so far.
Then can we try to help you.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Add onmouseover attribute to dropdown in code behind. This will plugin the client side onmouse over event. Once this is raised, you can do whatever you want in the related JavaScript method.
 
mydropdown.Attributes.Add("onmouseover","javascript:ddnMouseOver()");
  Permalink  
Comments
cscManoj22 at 5-Feb-13 23:58pm
   
above solution is not correct since it is happening only for dropdown not for dropdownlistitems
 
my req is when user select dropdownlist there will be a bunch of items populated
 
normally when we do mouseover on items the backcolor of the item changes to blue
 

hi i want to fill textbox value (not label-sry for mentioning label)
 
here is the code i am trying to do on mouseover
 

function ddnMouseOver(){
var StrPath="LookupXML.aspx?Caller=SubAccount;
var LookUpPath = ArrStrLocation[0] + "/" + ArrStrLocation[1] + "/" + ArrStrLocation[2] + "/" + ArrStrLocation[3] + "/" + StrPath;
SubAccountRequest = CreateRequest();
SubAccountRequest.onreadystatechange = ApplyOnsiteWarrantyHandler;
SubAccountRequest.open('POST', LookUpPath, true);
SubAccountRequest.send(null);
req.onreadystatechange = function()
{

window.status="Done";
dom = req.responseXML;
if (!IsHasErrorTable(dom))
{
var dr=new TableReader(dom, "dtPCase");
while(dr.MoveNext())
{
document.getElementById("Textbox1").value=dr.Column('BranchAccountLevel');
}
}
}
}
Sandeep Mewara at 6-Feb-13 0:14am
   
my req is when user select dropdownlist there will be a bunch of items populated
For this, in DataBound event of the dropdown, addthe same attribute to items.You have access to items in Databound event that occurs as many items you have.
cscManoj22 at 11-Feb-13 9:11am
   
hi can i have some sample code unable to achieve the above process
Sandeep Mewara at 11-Feb-13 9:55am
   
Something like:
protected void lstMultipleValues_DataBound(object sender, EventArgs e)
{
foreach (ListItem item in lstMultipleValues.Items)
{
//check anything out here
if (item.Text.StartsWith("B"))
item.Attributes.Add("style", "color:red");
}
}
cscManoj22 at 12-Feb-13 10:48am
   
thnks for u r great support sandeep i am very much impressed with u r quickanswers
 
but the above solution doesn't work
Sandeep Mewara at 12-Feb-13 11:59am
   
can you share what does not work and where did you find issue? did you debug?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 414
1 Maciej Los 180
2 Richard MacCutchan 140
3 DamithSL 129
4 Kornfeld Eliyahu Peter 119


Advertise | Privacy | Mobile
Web01 | 2.8.140709.1 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid