Search code examples
asp.netdatabaserefreshhideasp-literal

Asp Literal won't disappear after refreshing the page?


I have aspx page with asp Literal. It's the control page, and literal will show message, when data has been saved to database, (after pressing SAVE button).

It work, but after i have saved and trying to refresh page, the literal text won't disappear... Is there any nice and easy way to hide literal text after refreshing the page?

I have tried jquery .hide method, but i have faced another problems with that.

In front page script i have this value:

        Literall.text="Saved!!!" 

And end of the page i have this:

        <h2 style="color:red;">
            <asp:Literal id="Literall" Text="" runat="server"/>
        </h2>

Solution

  • Try using EnableViewState="False" on the Literal1 markup:

    <asp:Literal EnableViewState="False" id="Literall" Text="" runat="server"/>