<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
Can I get a response for this issue? I'm trying to get a string variable passed from a page back to a label on its parent tab page. In the suggestion made in this thread I don't see a way to pass the string variable.
I will need some time to investigate your issue. I will update you with my progress until the end of the business day tomorrow, 04/10.
Thank you for the code snippets, however, without a runnable sample I cannot debug it and therefore it will be hard for me to investigate further and find the root cause of the behavior.
I have created a sample project using Visual Basic and added a master page for management_general.aspx. Please modify the sample so that it replicates the behavior you are experiencing and send it back to me along with steps to reproduce and any information that you consider relevant.
This is going to be highly appreciated and will help mi in my further investigation.
Looking forward to hearing from you.
0726.Sample.zip
Martin,
I got it working yesterday by putting a js function on the parent page and executing the function on the child page, which allowed me to send the string variable needed in the label on the parent.
Hello Pat,
I am glad that you have resolved your issue.
Thank you for using Infragistics components.