T
tshad
I have an asp:Label that I am trying display some formatted text.
I can do this in my aspx page, but not from Javascript where I am getting
the text from the opener. I couldn't figure out why my script stopped
executing until I realized what was happening.
In my script I am doing this:
var toCoverLetterDisplay =
document.getElementById('_ctl0_ResumeDisplay_CoverLetterDisplay');
CoverLetterDisplay is an asp:Label which renders into a span element.
So
<asp:Label Text="<p>This is the CoverLetterDisplay</p>"
ID="CoverLetterDisplay" runat=server/>
Renders into
<span id="_ctl0_ResumeDisplay_CoverLetterDisplay"><p>This is the
CoverLetterDisplay</p></span>
In my asp code I can do:
CoverLetterDisplay.Text = "<p>This is the text from the
CoverLetterTextBox.</p>"
I can also do:
toCoverLetterDisplay.innerHTML = "This is a test"
But I can't do:
toCoverLetterDisplay.innerHTML = "<p>This is a test</p>;
or
var test = "<p>This is a test</p>";
toCoverLetterDisplay.innerHTML = test;
What is the problem?
I assume this has something to do with the chevrons.
The problem is that I am trying to move Formatted text from a textarea on my
opener page to an asp:Label on my new page. How do I do this in my
JavaScript function?
Thanks,
Tom
I can do this in my aspx page, but not from Javascript where I am getting
the text from the opener. I couldn't figure out why my script stopped
executing until I realized what was happening.
In my script I am doing this:
var toCoverLetterDisplay =
document.getElementById('_ctl0_ResumeDisplay_CoverLetterDisplay');
CoverLetterDisplay is an asp:Label which renders into a span element.
So
<asp:Label Text="<p>This is the CoverLetterDisplay</p>"
ID="CoverLetterDisplay" runat=server/>
Renders into
<span id="_ctl0_ResumeDisplay_CoverLetterDisplay"><p>This is the
CoverLetterDisplay</p></span>
In my asp code I can do:
CoverLetterDisplay.Text = "<p>This is the text from the
CoverLetterTextBox.</p>"
I can also do:
toCoverLetterDisplay.innerHTML = "This is a test"
But I can't do:
toCoverLetterDisplay.innerHTML = "<p>This is a test</p>;
or
var test = "<p>This is a test</p>";
toCoverLetterDisplay.innerHTML = test;
What is the problem?
I assume this has something to do with the chevrons.
The problem is that I am trying to move Formatted text from a textarea on my
opener page to an asp:Label on my new page. How do I do this in my
JavaScript function?
Thanks,
Tom