Question

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>
Was it helpful?

Solution

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

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

OTHER TIPS

put Literall.Text=""; in page load event

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top