简体   繁体   中英

Expose method as a property in user control

I created user control for textbox with autocompleteextender, and its working fine, but now i wanted to expose methods in user control to aspx page as a one of the property in user control,like in button control having onClientClick event. and forgive my English.

Try adding a property like this to your user control:

public string OnClientClick
{
    get { return Button1.OnClientClick; }
    set
    {
        Button1.OnClientClick = value;
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM