<asp:Label id="lblOne" runat="server" text="start here"/>
<ig:WebTab ID="WebTab1" runat="server" Height="700px" Width="100%"><PostBackOptions EnableLoadOnDemand="true" EnableAjax="true" /><ClientEvents SelectedIndexChanging="WebTab1_SelectedIndexChanging" /><Tabs> <ig:ContentTabItem runat="server" ScrollBars="Hidden" Key="General" Text="General" ContentUrl="management_general.aspx"> </ig:ContentTabItem> <ig:ContentTabItem runat="server" ScrollBars="Hidden" Key="Offices" Text="Offices" ContentUrl="management_offices.aspx"> </ig:ContentTabItem></Tabs> </ig:WebTab>
The above webtab is on management.aspx. From tab item management_general.aspx I need to be change the text of the label lblOne. Is this possible.
Hello,
Thank you for posting in our community.
What I can suggest is to use cross-origin communication between window objects. By calling the window's postMessage function from the iFrame and then listening to that message on the parent document, should resolve your issue.
management_general.aspx
<script> function changeLabel() { window.top.postMessage('message', location.origin); } </script>
management.aspx
<script> window.addEventListener('message', function (e) { var label = document.getElementById('<%= lblOne.ClientID %>'); label.innerHTML = "changed" }, false); </script>
I have created and attached a sample for your reference. Let me know if it helps you to achieve your requirements.
0243.Sample.zip
Here is the code I added:
management_general.aspx.vbPrivate Sub DetailButtons_Next_Clicked()lblComm is from a datasetDim js As String = "SetComm('" & lblComm & "'); return false;"AddHTMLAttribute(body.Attributes, "onload", js)
management_general.aspx<script type="text/javascript"> function SetComm(comm) {window.top.postMessage(comm, location.origin);}</script>
management.aspx<script type="text/javascript">var comm = '';window.addEventListener(comm, function (e) {var label = document.getElementById('<%= lblCommunityJDE.ClientID %>');label.innerHTML = comm }, false);<script>
FYI - management_general.aspx is in a ContentPlaceHolder of a master page.
The process gets to the SetComm function but does get to addEventListener.
Thanks, Pat