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

zachvaldezAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
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 HansenCommented:
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.
zachvaldezAuthor Commented:
Thanks. It's not changing it on click. How would I call this script?
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Julian HansenCommented:
You don't call it - it is an event handler and as long as you have set it up correctly it should just work.

Bear in mind you also have to
a) Include the jQuery library on your page BEFORE the script
b) The script should be in a document ready block
$(function() {
  $('.tab-link a').click(function() {
    $('label.label-target').html($(this).text());
  });
});

Open in new window


Finally, it is no use telling us it does not work without providing us with information on how you implemented it.

a) You could have forgotten to set up the script so it references the right class / id for the label
b) The script may not be linking to the tabs correctly
c) You may have placed the script outside of a document ready block
d) You may have placed it before the jQuery library
e) You may have forgotten to include the jQuery library
f) You may have made a typo that resulted in a script error - did you check the console (F12) for errors.

These are the things we need to know if we are going to help you.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
zachvaldezAuthor Commented:
Thanks for explaining a lot of this question. It just show you're expertise in the area
Julian HansenCommented:
You are welcome.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.