Re: dynamic controls not updated

Discussion in 'ASP .Net' started by Natty Gur, Jun 25, 2003.

  1. Natty Gur

    Natty Gur Guest

    try to set Response.Expires = -1. this will prevent your browser to get
    a page from the cache.

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Natty Gur, Jun 25, 2003
    #1
    1. Advertising

  2. Natty Gur

    Kelly Lim Guest

    Kelly Lim, Jun 25, 2003
    #2
    1. Advertising

  3. Natty Gur

    Natty Gur Guest

    Let’s check it on simple project with one page and 2 dynamic controls.
    Don’t copy from your existing project create new. It is still happening?
    If so send the project source. if the new project works OK it might be
    something in your code logic.

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Natty Gur, Jun 26, 2003
    #3
  4. Natty Gur

    Kelly Lim Guest

    Here is my code (After postback, I dynamically recreate the controls but
    with some changes but the changes aren't reflected:

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load
    'Put user code to initialize the page here

    Dim Radio1 As RadioButton
    Dim Radio2 As RadioButton
    Dim TextBox1 As TextBox

    If Not Me.IsPostBack Then
    TextBox1 = New TextBox()
    TextBox1.ID = "myTestBox1"
    TextBox1.Text = "Before postback"

    Me.FindControl("Form1").FindControl("plhTest").Controls.Add(TextBox1)

    Me.FindControl("Form1").FindControl("plhTest").Controls.Add(New
    LiteralControl("<br>"))

    Radio1 = New RadioButton()
    Radio1.ID = "myRadio1"
    Radio1.Text = "Red"
    Radio1.GroupName = "Color"
    Radio1.Checked = False

    Me.FindControl("Form1").FindControl("plhTest").Controls.Add(Radio1)

    Me.FindControl("Form1").FindControl("plhTest").Controls.Add(New
    LiteralControl("<br>"))

    Radio2 = New RadioButton()
    Radio2.ID = "myRadio2"
    Radio2.Text = "Blue"
    Radio2.GroupName = "Color"
    Radio2.Checked = False

    Me.FindControl("Form1").FindControl("plhTest").Controls.Add(Radio2)

    Me.FindControl("Form1").FindControl("plhTest").Controls.Add(New
    LiteralControl("<br>"))

    Else

    TextBox1 = New TextBox()
    TextBox1.ID = "myTestBox1"
    TextBox1.Text = "After postback"

    Me.FindControl("Form1").FindControl("plhTest").Controls.Add(TextBox1)

    Me.FindControl("Form1").FindControl("plhTest").Controls.Add(New
    LiteralControl("<br>"))

    Radio1 = New RadioButton()
    Radio1.ID = "myRadio1"
    Radio1.Text = "Red"
    Radio1.GroupName = "Color"
    Radio1.Checked = True

    Me.FindControl("Form1").FindControl("plhTest").Controls.Add(Radio1)

    Me.FindControl("Form1").FindControl("plhTest").Controls.Add(New
    LiteralControl("<br>"))

    Radio2 = New RadioButton()
    Radio2.ID = "myRadio2"
    Radio2.Text = "Blue"
    Radio2.GroupName = "Color"
    Radio2.Checked = True

    Me.FindControl("Form1").FindControl("plhTest").Controls.Add(Radio2)

    Me.FindControl("Form1").FindControl("plhTest").Controls.Add(New
    LiteralControl("<br>"))

    End If

    End Sub




    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Kelly Lim, Jun 26, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kelly

    dynamic controls not updated

    Kelly, Jun 25, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    880
    Natty Gur
    Jun 25, 2003
  2. Ronald
    Replies:
    2
    Views:
    860
    Robbe Morris [C# MVP]
    Jan 17, 2006
  3. Dave Weeden

    Controls not updated by callback event

    Dave Weeden, Aug 20, 2007, in forum: ASP .Net Building Controls
    Replies:
    4
    Views:
    914
    Walter Wang [MSFT]
    Aug 22, 2007
  4. Dmitry Korolyov

    Datagrid not updated during delete, but updated during insert and update

    Dmitry Korolyov, Sep 22, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    422
    Dmitry Korolyov
    Sep 22, 2003
  5. Denny Smolinski via .NET 247

    Dynamic Controls, Placeholder, Retrieve Information from Dynamic Controls

    Denny Smolinski via .NET 247, May 4, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    483
    Eidolon
    May 4, 2004
Loading...

Share This Page