/// <summary> /// This is used to ensure we render the lazy load script once before either the lazy js or css is rendered. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <remarks> /// See comments in PlaceholdersReplaced for more details /// </remarks> static void PlaceholderParserPlaceholderReplaced(object sender, PlaceholderReplacementEventArgs e) { //if the replacement was for this renderer if (e.RegexMatch.Groups.Count > 1 && e.RegexMatch.Groups[1].ToString() == DefaultName) { //we will pre-pend a special token above this output so we can detect it in the PlaceholdersReplaced event // and we'll tag the current http context with a key so we can detect that this reques is for us e.HttpContext.Items[PlaceholderReplacementProcessing] = true; e.ReplacedText = LazyLoadScriptPlaceholder + e.ReplacedText; } }
/// <summary> /// This is used to ensure we render the lazy load script once before either the lazy js or css is rendered. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <remarks> /// See comments in PlaceholdersReplaced for more details /// </remarks> static void PlaceholderParserPlaceholderReplaced(object sender, PlaceholderReplacementEventArgs e) { //if the replacement was for this renderer if (e.RegexMatch.Groups.Count > 1 && e.RegexMatch.Groups[1].ToString() == DefaultName) { //we will pre-pend a special token above this output so we can detect it in the PlaceholdersReplaced event // and we'll tag the current http context with a key so we can detect that this reques is for us e.HttpContext.Items[PlaceholderReplacementProcessing] = true; e.ReplacedText = LazyLoadScriptPlaceholder + e.ReplacedText; } }