CallBack Manager - Masterpage

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

i make my first steps with the Callback Manager
for example

function Script_CalculateValues(result,context)
{
alert("test : \n" + result);
//document.forms[0].elements["txtHG"].value = "2test";
//document.all.txtHG.Value = "2test";
//document.getElementById("txtHG").value = "fjkds";
//document.all.ContentPlaceHolder1.Label2.Text = "test";
}

When i use a Masterpage, i cannot access the textbox.
the contentplaceholder includes the textbox
all variants in the upper example were unsuccessful

ANY IDEA
 
Solution

document.getElementByID('ctl00_ContentPlaceHolder1_txtHG').value
 
You shouldn't hard-code this ID into your js code. Instead dynamically emit
the js with the Control.ClientID property -- this is the ID that the control
will have in the browser.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Solution

document.getElementByID('ctl00_ContentPlaceHolder1_txtHG').value

Sabine

Sabine said:
Hello

i make my first steps with the Callback Manager
for example
function Script_CalculateValues(result,context)
{
alert("test : \n" + result);
//document.forms[0].elements["txtHG"].value = "2test";
//document.all.txtHG.Value = "2test";
//document.getElementById("txtHG").value = "fjkds";
//document.all.ContentPlaceHolder1.Label2.Text = "test";
}
When i use a Masterpage, i cannot access the textbox.
the contentplaceholder includes the textbox
all variants in the upper example were unsuccessful
ANY IDEA

-- THANKS

Sabine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top