Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a page where I create a dynamic table, containing dynamic controls which raise events. When i click the save button all the controls are disappeared and How to recreate a control inside grid

What I have tried:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    LoadControl()
End Sub
Posted
Updated 10-Apr-20 2:11am
Comments
CHill60 8-Apr-20 12:16pm    
You're going to have to provide a bit more code than that! What has LoadControl got to do with the Save button?
If you are loading the controls on Page Load then I'm guessing the Save button does a postback - you should check for that in your page load event

1 solution

As per my comment - check for postback before reloading the controls as documented here Page.IsPostBack Property (System.Web.UI) | Microsoft Docs[^]
C#
private void Page_Load()
{
    if (!IsPostBack)
    {
        LoadControl()
    }
}
 
Share this answer
 
Comments
Member 14796273 10-Apr-20 8:13am    
Reload grid(Recreate Dynamic control) in postback i able retrieve the value But Physical controls values are lost when reload grid in postback.
CHill60 16-Apr-20 4:02am    
As I said in my original comment - you are going to have to supply the code. Have you put in the check for IsPostBack or not? If not, then that is probably why the controls are losing their value. We cannot see your code so we cannot help further until *you* update your question

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900