This is a migrated thread and some comments may be shown as answers.

RadWindow - Render html verbatim in title

2 Answers 58 Views
Window
This is a migrated thread and some comments may be shown as answers.
jf820
Top achievements
Rank 1
jf820 asked on 25 May 2012, 09:37 PM
I'm finally biting the bullet and converting over from the old asp.net controls to asp.net for ajax, and one thing is vexing me.

In the old world, we took advantage of the fact that the title on a radwindow was rendered out verbatim to stick spans and the like into the Title on an as-needed basis from c# code for styling (ie, stylesheets will not work) and in a couple of cases, an onclick javascript function... something like:
if (someCondition)
  Title = "<span style='color:red'>" + blah + "</span>";
else if (someOtherCondition)
  Title = "<span style='color:green' onclick='doSomething();'>" + blah + "</span>";
else
  Title = blah;

In asp.net for ajax, though, it looks like the title is now being rendered after a run through Server.HtmlEncode.

Researching shows that maybe it's related to PITS entry 2541 and this thread : http://www.telerik.com/community/forums/aspnet-ajax/window/html-element-is-rendered-in-page-title.aspx

Am I looking at having to use set_title() in javascript to deal with this, or is there a property I can set on the Window/WindowManager declaration to make the window take the page's title verbatim, without running it through Server.HtmlEncode?

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 29 May 2012, 03:42 PM
Hello,

Indeed, this behavior was changed and now you can set an HTML string through the client-side set_title() method and there isn't a property to revert to the old behavior. It was changed not only because of requests, but also because it used to expose a css vulnerability.


Regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
jf820
Top achievements
Rank 1
answered on 29 May 2012, 07:06 PM
I was afraid you'd say that... Not a big deal to do, I was just hoping there'd be a property to set and I could call it done.

Thanks for getting back to me.
Tags
Window
Asked by
jf820
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
jf820
Top achievements
Rank 1
Share this question
or