Click here to Skip to main content
11,436,156 members (64,821 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript
I Have tracked Event on button click so I call onclick event javascript:CallingEventTrackRelatedJoint for track the event & Redirect page using code behind C# function btnEventTrack_Click.I not specift href with a html tag due to track event.
 
I want to display href text in status bar & so i set window.status but it is not work.
 
how can I display href text in Status bar please help me.
 
Below is My Code.
 
--------------------------------
HTML
-------------------------------
 
<span style="cursor: pointer"><a onclick="javascript:CallingEventTrackRelatedJoint('CONTRIBUTORS',0,'<%#Eval("ContributorID") %>' ,'','','','','ContributorProfile.aspx?ContributorID=<%#Eval("ContributorID") %>','');">
                                            <asp:Label ID="lblContributorName" runat="server" Text='<%#Eval("Name") %>' CssClass="lblContributorname"></asp:Label></a></span>
 

 <div >
                    <asp:Button ID="btnEventTrack" Width="0" runat="server" OnClick="btnEventTrack_Click" />
                    <asp:HiddenField ID="hdnEventID" runat="server" />
                    <asp:HiddenField ID="hdnCategoryID" runat="server" />
                    <asp:HiddenField ID="hdnMemberID" runat="server" />
                    <asp:HiddenField ID="hdnAttributeA" runat="server" />
                    <asp:HiddenField ID="hdnAttributeB" runat="server" />
                    <asp:HiddenField ID="hdnAttributeC" runat="server" />
                    <asp:HiddenField ID="hdnAttributeD" runat="server" />
                    <asp:HiddenField ID="hdnAttributeE" runat="server" />
                    <asp:HiddenField ID="hdnRedirectPageUrl" runat="server" />
                    <asp:HiddenField ID="hdnTarget" runat="server" />
                    <asp:HiddenField ID="hdnIDRedirectPage" runat="server" />
                    <asp:HiddenField ID="hdnTestimonials" runat="server" />
                    <asp:HiddenField ID="hdnIPAddress" runat="server" />
                </div>
 
--------------------------------------------
JAVASCRIPT FUNCTION
--------------------------------------------
 
<script type="text/javascript">
function CallingEventTrackRelatedJoint(pstrSectionName,pIntCategoryID, pStrAttributeA, pStrAttributeB, pStrAttributeC, pStrAttributeD, pStrAttributeE, pRedirectPageUrl, pTarget) {
 
    var TrackEventID = '';
    var pathArray = window.location.pathname.split( '/' );
    var newPathname = "";
    for ( i = 0; i < pathArray.length; i++ ) {
        if(pathArray[i]=='bethanys-story.aspx')
        {
           if(pstrSectionName == 'BOOKS')
           {
             TrackEventID = 30;
           }
           else if(pstrSectionName == 'CONTRIBUTORS')
           {
             TrackEventID = 31;
           }
 

        }
 
    }
window.status = pRedirectPageUrl;
 
    EventTrack(TrackEventID, pIntCategoryID, pStrAttributeA, pStrAttributeB, pStrAttributeC, pStrAttributeD, pStrAttributeE, pRedirectPageUrl, pTarget);
}
 </script>
 
_______________________
EventTrack.js
_________________________
function EventTrack(pIntEventID, pIntCategoryID, pStrAttributeA, pStrAttributeB, pStrAttributeC, pStrAttributeD, pStrAttributeE, pRedirectPageUrl, pTarget) {
 
    document.getElementById('MainContent_hdnEventID').value = pIntEventID;
 
    document.getElementById('MainContent_hdnCategoryID').value = pIntCategoryID;
 
    document.getElementById('MainContent_hdnAttributeA').value = pStrAttributeA;
 
    document.getElementById('MainContent_hdnAttributeB').value = pStrAttributeB;
 
    document.getElementById('MainContent_hdnAttributeC').value = pStrAttributeC;
 
    document.getElementById('MainContent_hdnAttributeD').value = pStrAttributeD;
 
    document.getElementById('MainContent_hdnAttributeE').value = pStrAttributeE;
 
    document.getElementById('MainContent_hdnRedirectPageUrl').value = pRedirectPageUrl;
 
    document.getElementById('MainContent_hdnTarget').value = pTarget;
    document.getElementById('MainContent_btnEventTrack').click();
 
    return false;
 
}
 

________________
Code Behind C#
________________
 
 protected void btnEventTrack_Click(object sender, EventArgs e)
    {
        Decimal decMemberID = 0;
        CommonFunctions.TrackEvent(decMemberID, Convert.ToDecimal(hdnCategoryID.Value), Convert.ToDecimal(hdnEventID.Value), hdnAttributeA.Value, hdnAttributeB.Value, hdnAttributeC.Value, hdnAttributeD.Value, hdnAttributeE.Value);
        if (hdnRedirectPageUrl.Value != String.Empty)
        {
            Response.Redirect(hdnRedirectPageUrl.Value);
        }
    }
 

 

Please Javascript & .Net Developer try this code and find the solution.it is challenging job for JavaScript & .Net developer.
 

Please Help me asap.
Thanks.
Posted 18-Jan-13 1:42am
Edited 18-Jan-13 1:43am
v2

1 solution

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

Solution 1

Here is what W3Schools.com say:
The status property does not work in the default configuration of IE, Firefox, Chrome, or Safari. To allow scripts to change the text of the status, the user must set the dom.disable_window_status_change preference to false in the about:config screen. (or in Firefox: "Tools - Options - Content -Enable JavaScript / Advanced - Allow scripts to change status bar text").

Here is what you say:
Please Javascript & .Net Developer try this code and find the solution.it is challenging job for JavaScript & .Net developer.
Now check this[^] link.
  Permalink  

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



Advertise | Privacy | Mobile
Web03 | 2.8.150428.2 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100