This is a migrated thread and some comments may be shown as answers.

Adding dynamic controls (first time does not work)

1 Answer 112 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Sandrino
Top achievements
Rank 1
Sandrino asked on 27 Oct 2008, 04:47 PM

Dear Support,

I'm having a little issue with the Ajax Manager.

With a button, I would like to dynamically add RadNumericTextboxes to a simple html table.
This is a fraction of the code:

        // click new row  
        protected void buttonNewRow_Click(object sender, EventArgs e)  
        {  
            // session  
            if (Session["rowCount"] == null)  
                Session["rowCount"] = 0;  
 
            // get int  
            int rowCount = (int)Session["rowCount"];  
            Session["rowCount"] = ++rowCount;  
        }  
         
        // load page  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            // add 5 rows by default  
            for (int i = 0; i < 5; i++)  
                AddRow();  
 
            // add button clicked rows  
            if (Session["rowCount"] != null)  
            {  
                for (int i = 0; i < (int)Session["rowCount"]; i++)  
                    AddRow();  
            }          
        } 

Everything works fine, except... the first time I click nothing happens!
Is there any way to solve this issue? Or am I doing it totally wrong?

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 28 Oct 2008, 07:22 AM
Hello Sandrino,

Can you verify if your scenarios works normally without RadAjaxManager? It is not clear also how manager is used in your case - can you clarify?

All the best,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Sandrino
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or