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

update stylesheets within head-tag

3 Answers 51 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Bernhard Rosenfelder
Top achievements
Rank 1
Bernhard Rosenfelder asked on 19 Jul 2011, 07:04 AM
hi community,

does anybody know how to update stylesheets within head-tag per ajax?

thank you for your help
bernhard

3 Answers, 1 is accepted

Sort by
0
Kiara
Top achievements
Rank 1
answered on 19 Jul 2011, 09:54 AM
Are you looking for page head updates during ajax requests? If yes, try to use the EnablePageHeadUpdate property of the telerik ajax manager or panel. In case you want to register the skins of the controls after async request, set their EnableAjaxSkinRendering property as in this example:
http://demos.telerik.com/aspnet-ajax/ajax/examples/common/showingwebcontrols/defaultcs.aspx

Hope my guidelines are helpful.

Kiara
0
Bernhard Rosenfelder
Top achievements
Rank 1
answered on 19 Jul 2011, 12:50 PM
hi kiara,

i tried to use the EnablePageHeadUpdate property but the RadAjaxManager didn't update the style tag within the head.
<head runat="server" id="head1">
    <title></title>
    <style runat="server" id="stylepanel1" type="text/css" customvisibility="0">
            .panel1 { visibility: hidden; display: none; }
    </style>
</head>

Protected Sub RadButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles RadButton1.Click
        Dim Style As HtmlGenericControl = Header.FindControl("stylepanel1")
        Style.InnerText = ".panel1 { visibility: hidden; }"
    End Sub

is here something wrong?

regards,
bernhard
0
Kiara
Top achievements
Rank 1
answered on 20 Jul 2011, 09:54 AM
I see what you mean now. I doubt what you want is attainable because as far as I know the ajax manager/panel cannot update elements outside of the body tag.  I stand corrected though, especially if you can manage to that with MS UpdatePanels.

Kiara
Tags
Ajax
Asked by
Bernhard Rosenfelder
Top achievements
Rank 1
Answers by
Kiara
Top achievements
Rank 1
Bernhard Rosenfelder
Top achievements
Rank 1
Share this question
or