User control history RRS feed

  • Question

  • User632741198 posted

    I have a user control and its loaded page .IF i click back button (history) from browser page load event not fired.its loaded from cache.kindly advise me 

    Monday, April 20, 2020 9:12 AM

All replies

  • User-719153870 posted

    Hi tanbchn,

    To disable it loads from cache, please add below code in user control's page load event:


    Below is the complete demo to reproduce the issue:


    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UCDemo01.ascx.cs" Inherits="WebFormDemo01.UCDemo01" %>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>


            protected void Page_Load(object sender, EventArgs e)
                TextBox1.Text = DateTime.Now.ToString();
                TextBox1.ReadOnly = true;


    <%@ Page Title="About" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="About.aspx.cs" Inherits="WebFormDemo01.About" %>
    <%@ Register TagPrefix="UCs" TagName="UCDemo" Src="~/UCDemo01.ascx" %>
    <asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
        <h2><%: Title %>.</h2>
        <h3>Your application description page.</h3>
        <p>Use this area to provide additional information.</p>
        <UCs:UCDemo runat="server" ID="UC01" />

    Here's the result of this demo:

    Best Regard,

    Yang Shen

    Tuesday, April 21, 2020 2:12 AM