views:

274

answers:

4

hi, i'm using sifr 3 and i'm doing font replacement inside updatepanel. after postback the flash disappear and i get the pld font instead. what to do? please help me. thanks ;)

A: 

Mark,

Here's an example of sIFR breaking when an ASP.NET UpdatePanel control is updated asynchronously.

In this screencast, selecting a new date on the calendar control updates two UpdatePanel controls, one below the calendar and also the main content block (with the sIFR heading). You can see the date/time updating, but the sIFR text disappears...

http://screencast.com/t/Hlk5EsJ2jMr

Cheers,

Mike

A: 

You'll need to run the sifr update after your updatepanel is finished..

You can write a script to attach to the PageRequestManager, using an event like add_endRequest.

ArjanP
A: 

I have similiar issue using jQuery BlockUI and an UpdatePanel where the page refreshes and the SIFR font disappears.

In the Javascript file I use to handle the blocking and unblocking of the UI, I detect the partial postback and unblock the UI:

prm.add_endRequest(function() {
$.unblockUI(); });

If I re-run sIFR.replace() in this code block the font sIFR font is rendered, but # characters are replacing my page title (in the top of the browser window/tab). Each time I refresh the page an extra # character is added, so my page title ends up looking like "#########". Any idea why this is happening?

Is there a specific sIFR.update() function I should be running instead?

Markis
A: 

You could put this snippet in your html code:

<script type="text/javascript">
    function pageLoad(sender, args) {       
        sIFR.replace(font, { selector: '#content h2' });    
    }
</script>

It will run the sIFR replacements each time the page reloads. This is on normal PostBack and Ajax postbacks. Make sure you have included a ScriptManager instance on your page.

note: this question is similar to: sIFR not working with prototype AJAX page load.

mathijsuitmegen