0
votes

I have a Button1 and a textbox. When i put a value in textbox and click this button then a new button is created with the value filled in textbox but i want that when again i click Button1 and there should be one more button or we can say how to move previous button's position?

This is code for Button1 in .aspx.cs

protected void Button1_Click(object sender, EventArgs e) {

        Button btnNew = new Button();
        btnNew.ID = "btnNew";
        btnNew.Text = textBox1.Text;

        form1.Controls.Add(btnNew);
    }

Please help me to solve this. Thanks in advance.

1
You probably need to use javascript. Please post some code and give more detail, because your question is not very clear. - Matt
please see the edited code. - Arwinder Singh
That is not MVC. Please remove the asp.net-mvc tag from this post. - Matt

1 Answers

0
votes

You could probably do something like this with JavaScript/jQuery:

$('#button1').click(function() {
    $('#button2').css('position', 'absolute');
    $('#button2').css('top', '50px');
});

etc. You should provide more info as suggested by Matt.