How can i use both client side click and server side click on single RadTrip

2 posts, 0 answers
  1. Anwar
    Anwar avatar
    31 posts
    Member since:
    Aug 2011

    Posted 21 Sep 2011 Link to this post

    Hi telerik team,
      I am using radTabStrib in our application which contains 6 tab pages and i have implemented both OnClientTabSelected and OnTabClick events on it.Here i am not getting OnClientTabSelected  result.
    This is my code..
       <telerik:RadTabStrip ID="CampaignRadTabStrip" runat="server" SelectedIndex="0" Skin="Default"
                                    MultiPageID="RadMultiPage1" Width="100%" ValidationGroup="UpdateValidationGroup(this);"
                                    CausesValidation="true" OnTabClick="CampaignRadTabStrip_TabClick" OnClientTabSelected="bind"  >
    this is my javascript code:
                    function bindConfirmation(sender, args) {
            //            debugger;
                        var tabText = args.get_tab().get_text();
                        var fromName = document.getElementById('<%= txtFromName.ClientID %>').value;

                       var sunjectLine = document.getElementById('<%= txtSubject.ClientID %>').value;
                        var txtFromAddress = document.getElementById('<%= lblFromAddress.ClientID%>').innerHTML;
                        var txtSelectedDate = document.getElementById('<%= txtSelectedDate.ClientID %>').value;
                        var lstBoxListNames = document.getElementById('<%= lstBoxListNames.ClientID%>');
                        //var RadEditor = document.getElementById('<%= RadEditor1.ClientID%>');
                        //var text = RadEditor.GetText();
                        //var textRadEditor = document.getElementById('<%= textRadEditor.ClientID%>');
                        var editor = $find("<%=RadEditor1.ClientID%>"); //get a reference to RadEditor client object
                        var oSelElem = editor.get_text();
                        var Texteditor = $find("<%=textRadEditor.ClientID%>"); //get a reference to RadEditor client object
                        var TSelElem = Texteditor.get_text();
                        var chkTrackReads = document.getElementById('<%= chkTrackReads.ClientID%>');
                        if (tabText == "Confirmation") {

                            if (fromName.length > 0) {
                                document.getElementById('<%=imgFromName.ClientID%>').src = "../Images/Approved-icon.png";
                                document.getElementById('<%=lblFromNameget.ClientID%>').innerHTML = fromName;
                            }
                            else
                                document.getElementById('<%=imgFromName.ClientID%>').src = "../Images/delete-icon.png";

                            if (sunjectLine.length > 0) {
                                document.getElementById('<%=imgSubject.ClientID%>').src = "../Images/Approved-icon.png";
                                document.getElementById('<%=lblSubjectget.ClientID%>').innerHTML = sunjectLine;
                            }
                            else
                                document.getElementById('<%=imgSubject.ClientID%>').src = "../Images/delete-icon.png";


                            if (txtFromAddress.length > 0) {
                                document.getElementById('<%=imgFromAddress.ClientID%>').src = "../Images/Approved-icon.png";
                                document.getElementById('<%=lblFromAddressget.ClientID%>').innerHTML = txtFromAddress;
                            }
                            else
                                document.getElementById('<%=imgFromAddress.ClientID%>').src = "../Images/delete-icon.png";

                            if (lstBoxListNames.length > 0) {
                                document.getElementById('<%=imgContacts.ClientID%>').src = "../Images/Approved-icon.png";
                                document.getElementById('<%=lblContactsget.ClientID%>').innerHTML = lstBoxListNames[0].innerHTML;
                            }
                            else
                                document.getElementById('<%=imgContacts.ClientID%>').src = "../Images/delete-icon.png";

                            if (txtSelectedDate.length > 0) {
                                document.getElementById('<%=imgDeliveryDate.ClientID%>').src = "../Images/Approved-icon.png";
                                document.getElementById('<%=lblDeliveryDateget.ClientID%>').innerHTML = "Later/Schduled";
                            }
                            else {
                                document.getElementById('<%=imgDeliveryDate.ClientID%>').src = "../Images/Approved-icon.png";
                                document.getElementById('<%=lblDeliveryDateget.ClientID%>').innerHTML = "Immediate/Schduled";
                            }

                            if (oSelElem != "")
                                document.getElementById('<%=imgHtmlContent.ClientID%>').src = "../Images/Approved-icon.png";
                            else
                                document.getElementById('<%=imgHtmlContent.ClientID%>').src = "../Images/delete-icon.png";


                            if (TSelElem != "")
                                document.getElementById('<%=imgTextContent.ClientID%>').src = "../Images/Approved-icon.png";
                            else
                                document.getElementById('<%=imgTextContent.ClientID%>').src = "../Images/delete-icon.png";


                            if (chkTrackReads.type == "checkbox") {
                                if (chkTrackReads.checked == true) {
                                    document.getElementById('<%=imgLinkTracked.ClientID%>').src = "../Images/Approved-icon.png";

                                }
                                else
                                    document.getElementById('<%=imgLinkTracked.ClientID%>').src = "../Images/delete-icon.png";

                            }

                        

                        }

                        return false;     

    }

    the above function is working properly when i remove Server side tab click event.But i need to use both the events.
               
  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 21 Sep 2011 Link to this post

    Hello Anwar,

    You should handle the OnClientTabSelecting event, if you want your client-side code to happen before the server-side event is raised.

    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top