Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to create a user control that is client side,
I have a html page that my control (I want to be added to the page) is in it.
I have css and javascript functions in my html file.
By clicking the button my control should be appeared on the page.
I used this method:

HTML
div id="divMain">
        <label id="lblTitle">Add Here ...</label>
    </div>
    <div>
        <input type="button" id="btnAddControl" value="Add Control"/>
    </div> 


JavaScript
$("#btnAddControl").click(function () { $("#divMain").append($("<div></div>").load('HTMLPage.htm')) });


The problem is in the second click.
first one is ok and it shows all the elements of my control.
but on second click it doesn't know javascript functions and js functions doesn't work

Please help me...
Is there any solution?

Thanks
Bahar
Posted
Comments
Bryian Tan 5-Jul-12 21:34pm    
Can you provide the steps to replicate your issue?

1 solution

Ideally it should not behave like that you should explain your scenario more clearly.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900