Click here to Skip to main content
15,896,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Om mouse over -->i want to display the entire details -->on mouse out nothing
C#
protected void gridShuttleAdmin_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //onmouse over and mouse out on the grid color changes
            e.Row.Attributes.Add("onmouseover", "this.previous_color=this.style.backgroundColor;this.style.backgroundColor='PaleGreen'");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.previous_color;");

            Label lbltrip = (Label)e.Row.FindControl("lbltrip");
            string StopInformation = DataBinder.Eval(e.Row.DataItem, "StopName_HTML").ToString();
            if (lbltrip != null)
            {
                Label lblshuttledetailname = (Label)e.Row.FindControl("lblshuttledetailname");
                Label lblshuttlefacilityid = (Label)e.Row.FindControl("lblshuttlefacilityid");
                Label lblfacilityid = (Label)e.Row.FindControl("lblfacilityid");
                LinkButton lbtn = (LinkButton)e.Row.FindControl("lnkviewID");
                lbtn.Attributes.Add("onClick", "var sFeatures='dialogHeight: 700px;dialogWidth: 1000px;'; window.showModalDialog('Shuttle_StopDetails.aspx?shuttlefacilityid=" + lblshuttlefacilityid.Text + "&facility=" + lblfacilityid.Text + "&Trip=" + lbltrip.Text + "','',sFeatures);window.document.forms[0].submit();");

            }
            e.Row.Attributes.Add("onmouseover", "javascript:Tip('" + StopInformation + "', TITLE, 'Stop Information', TITLEFONTFACE, 'Verdana,sans-serif');");
            e.Row.Attributes.Add("onmouseout", "javascript:UnTip();");
        }
    }

I am getting error as
Microsoft JScript runtime error: 'TITLE' is undefined
Microsoft JScript runtime error: Object expected

//
in sql:in my stored procedure i am calling a
SQL
 function....dbo.fnc_CreateHTML_StopDetails_tripdetail(dbo.TBL_SHUTTLE_FACILITY_TRIP.Shuttle_Facility_Id)
// 

 =============================================    
ALTER PROCEDURE [dbo].[USP_SHUTTLE_DETAILS] 
(    
@facility_id int,    
@triplist int    
)    
AS    
BEGIN     
SET NOCOUNT ON     
    
declare @shuttle varchar(max)    
set @shuttle = 'select Trip_num,Shuttle_Facility_DetailName,facility_id,Shuttle_Facility_Id,Shuttle_Seats,Shuttle_Number,dbo.fnc_CreateHTML_StopDetails_tripdetail(dbo.TBL_SHUTTLE_FACILITY_TRIP.Shuttle_Facility_Id)  as StopName_HTML    
from TBL_SHUTTLE_FACILITY_TRIP     
where facility_id='+ cast (@facility_id as varchar) + ' AND inactive=0'    
    
    
    
If (@triplist <> '0' AND @triplist <> '-1')    
begin    
set @shuttle =@shuttle+ ' and   Trip_num= '+ cast(@triplist as varchar)+''    
END    
    
set @shuttle = @shuttle + 'order by Trip_num asc'    
exec (@shuttle)    
    
    
    
SET NOCOUNT OFF    
END    

[Edit]Code block formatting added[/Edit]
Posted
Updated 24-Jun-13 5:30am
v3
Comments
José Amílcar Casimiro 24-Jun-13 12:11pm    
javascript:Tip <- What is the second parameter in this method?

1 solution

If I understand the issue correctly, I believe the problem is with your javascript.

In your code you have the following line:

C#
e.Row.Attributes.Add("onmouseover", "javascript:Tip('" + StopInformation + "', TITLE, 'Stop Information', TITLEFONTFACE, 'Verdana,sans-serif');");


Is TITLE suppose to be a variable or a static value? The javascript Tip() function currently thinks it's a javascript variable but it doesn't exist on the client. Can you post the JavaScript code you are using?
 
Share this answer
 

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