Click here to Skip to main content
15,886,919 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: WebControl SPAN tag Pin
Tom John8-Jun-07 3:41
Tom John8-Jun-07 3:41 
Questionunable to convert VS2003 project to VS2005 Pin
papy-boom7-Jun-07 23:04
papy-boom7-Jun-07 23:04 
AnswerRe: unable to convert VS2003 project to VS2005 Pin
Venkatesh Mookkan7-Jun-07 23:22
Venkatesh Mookkan7-Jun-07 23:22 
GeneralRe: unable to convert VS2003 project to VS2005 Pin
papy-boom7-Jun-07 23:37
papy-boom7-Jun-07 23:37 
QuestionDynamic Adding Controls to Placeholder & presisit during postback Pin
adnanrafiq7-Jun-07 22:45
adnanrafiq7-Jun-07 22:45 
AnswerRe: Dynamic Adding Controls to Placeholder & presisit during postback Pin
Tom John8-Jun-07 0:02
Tom John8-Jun-07 0:02 
GeneralRe: Dynamic Adding Controls to Placeholder & presisit during postback Pin
adnanrafiq8-Jun-07 0:56
adnanrafiq8-Jun-07 0:56 
GeneralRe: Dynamic Adding Controls to Placeholder & presisit during postback Pin
Tom John8-Jun-07 7:41
Tom John8-Jun-07 7:41 
The following will do what you are after. It assumes you have a ASPX page with an UpdatePanel containing a PlaceHolder and a Button:

Partial Public Class _Default
    Inherits System.Web.UI.Page

    Private Property TextBoxCount() As Integer
        Get
            If ViewState("TextBoxCount") Is Nothing Then
                ViewState("TextBoxCount") = 1
            End If
            Return CInt(ViewState("TextBoxCount"))
        End Get
        Set(ByVal value As Integer)
            ViewState("TextBoxCount") = value
        End Set
    End Property

    Protected Overrides Sub CreateChildControls()
        MyBase.CreateChildControls()

        For textBoxCounter As Integer = 1 To TextBoxCount
            AddButton()
        Next

    End Sub

    Private Sub AddButton()

        Dim textBox As New TextBox
        textBox.ID = "TextBox" + PlaceHolder1.Controls.Count.ToString
        PlaceHolder1.Controls.Add(textBox)

    End Sub

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click

        AddButton()
        TextBoxCount += 1

    End Sub

End Class


I can send you the sample project if you want.

Cheers

Tom
Questionhow to disabled control asp.net 2003? [modified] Pin
moomoooomoo7-Jun-07 22:35
moomoooomoo7-Jun-07 22:35 
AnswerRe: how to disabled control asp.net 2003? Pin
Manas Bhardwaj7-Jun-07 23:07
professionalManas Bhardwaj7-Jun-07 23:07 
QuestionUpdate GridView on Runtime? Pin
Biju Sam7-Jun-07 22:25
Biju Sam7-Jun-07 22:25 
QuestionExport with Style sheet from Datatable to excel Pin
Biju Sam7-Jun-07 22:23
Biju Sam7-Jun-07 22:23 
QuestionAjax UpdatePanel Flicks! Pin
Gamzun7-Jun-07 22:10
Gamzun7-Jun-07 22:10 
AnswerRe: Ajax UpdatePanel Flicks! Pin
Venkatesh Mookkan7-Jun-07 22:25
Venkatesh Mookkan7-Jun-07 22:25 
GeneralRe: Ajax UpdatePanel Flicks! Pin
Gamzun8-Jun-07 0:23
Gamzun8-Jun-07 0:23 
QuestionExport Dataset/ DataTable into Excel? Pin
Jay_se7-Jun-07 21:48
Jay_se7-Jun-07 21:48 
AnswerRe: Export Dataset/ DataTable into Excel? Pin
wEb GuRu...7-Jun-07 21:57
wEb GuRu...7-Jun-07 21:57 
Questionasp.net1.1 applications exception Pin
TheEagle7-Jun-07 21:23
TheEagle7-Jun-07 21:23 
AnswerRe: asp.net1.1 applications exception Pin
Sathesh Sakthivel7-Jun-07 21:30
Sathesh Sakthivel7-Jun-07 21:30 
GeneralRe: asp.net1.1 applications exception Pin
Vasudevan Deepak Kumar7-Jun-07 21:43
Vasudevan Deepak Kumar7-Jun-07 21:43 
GeneralRe: asp.net1.1 applications exception Pin
TheEagle8-Jun-07 18:44
TheEagle8-Jun-07 18:44 
GeneralRe: asp.net1.1 applications exception Pin
TheEagle7-Jun-07 21:45
TheEagle7-Jun-07 21:45 
GeneralRe: asp.net1.1 applications exception Pin
Sathesh Sakthivel7-Jun-07 22:12
Sathesh Sakthivel7-Jun-07 22:12 
GeneralRe: asp.net1.1 applications exception Pin
TheEagle8-Jun-07 0:13
TheEagle8-Jun-07 0:13 
QuestionAbout print , use asp.net with c# Pin
wongeva7-Jun-07 21:21
wongeva7-Jun-07 21:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.