Link to home
Create AccountLog in
Avatar of zachvaldez
zachvaldezFlag 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

Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

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
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.
Avatar of zachvaldez

ASKER

Thanks. It's not changing it on click. How would I call this script?
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Thanks for explaining a lot of this question. It just show you're expertise in the area
You are welcome.