Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Comments
[no name] 5-Feb-13 8:32am    
Let us know what you've cracked so far !
ZurdoDev 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?
Jameel VM 5-Feb-13 9:00am    
which label value you want to replace?selected item value?
P_Dash 5-Feb-13 11:50am    
Well share your code what you have used so far.
Then can we try to help you.

1 solution

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.

C#
mydropdown.Attributes.Add("onmouseover","javascript:ddnMouseOver()");
 
Share this answer
 
Comments
cscManoj22 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 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 11-Feb-13 9:11am    
hi can i have some sample code unable to achieve the above process
Sandeep Mewara 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 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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900