Avatar of zachvaldez
zachvaldez
Flag for United States of America asked on

Writing value to a control in Masterpage from a child page.

I have a label control in my Masterpage and I would like the  text property of tab I click in the child place
assigned to the label in the Masterpage. Please show example.

 <ul class="tabs" id="thistab" runat="server">

                <li class="tab-link current" data-tab="tab-1" id="tab11" data-toggle="tab"><a href="#Person">Personal Info</a></li>

                <li class="tab-link" data-tab="tab-6" id="tab16"><a href="#Info" data-toggle="tab"                <li class="tab-link" data-tab="tab-2" id="tab12"><a href="#Assign" data-toggle="tab" title="Assignment History">Assignment History</a></li>
                <li class="tab-link" data-tab="tab-3" id="tab13"><a href="#Issues" data-toggle="tab" title="Issues">Issues</a>

</ul>

Open in new window

ASP.NETJavaScriptC#jQuery

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon
Julian Hansen

Generally this would be

$('.tab-link a').click(function() {
  // either
  // $('#idoflabel').html($(this).text())); OR
  $('label.label-target').html($(this).text());
});

Open in new window


Change the .label-target to the id of the target label or a class associated with that label
Julian Hansen

Just a note on Master / Child pages. This only has meaning in the context of the server-side C# code. There is no distinction between master and child content once the HTML arrives in the browser - there is just one flat page.
zachvaldez

ASKER
Thanks. It's not changing it on click. How would I call this script?
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
Julian Hansen

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
zachvaldez

ASKER
Thanks for explaining a lot of this question. It just show you're expertise in the area
Julian Hansen

You are welcome.