-
Problem in adding a button to a page.
about 9 years ago
-
about 9 years ago
The answer of your question is Yes. In this case, you will have to re-create your dynamic controls in the Page_Init event - which occurs before the ViewState is loaded. You can create controls for the first time in Page_Load - just make sure to recreate them in Page_Init when the page gets loaded again.
Can you mark answer as Correct if it solves your problem.
-
about 9 years ago
Thank you so much.
-
-
about 9 years ago
Dear Chetan.Sharda, Thank you. It worked like a charm. My problem is fixed. But one question: by this way I can get rid of that error, but what would happen if I want to use viewstate somewhere in my code? Can I use it or no?
-
-
about 9 years ago
You can disable the VIEWSTATE of the ASPX page : <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="****.aspx.cs" Inherits="****" EnableViewState="false"%>Let me know if it solves your problem.
-
4 Answer(s)