How to add controls dynamically when click button in asp.net?

前端 未结 3 1311
没有蜡笔的小新
没有蜡笔的小新 2020-12-18 03:36

I\'m trying to add controls dynamically

Code:

AddVisaControl.ascx

<%@ Control Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"AddVi         


        
3条回答
  •  误落风尘
    2020-12-18 03:56

    if you remove the static 'i' variable and use a hidenInput to maintain the no of created controls (or a session value) you will be fine.

    But I suggest you read the following article to find a better way of creating dynamic controls :

    Dynamic control creation in ASP.NET

提交回复
热议问题