As you already know custom control gives the flexibility and allows to add complex features for a server control (refer to MSDN:Developing and Using a Custom Web Server Control).
Now consider you would like to display modal dialog using JQuery UI and the respective .js files are already loaded by the main website.The following snippet allows you to display a button from your custom control and generate a script block on the client side to handle the click event.
This is the simple case of explaining how to achieve it.
The most overlooked advantage to owning a computer is that if they foul up, there's no law against whacking them around a little. ~Eric Porterfield.
Now consider you would like to display modal dialog using JQuery UI and the respective .js files are already loaded by the main website.The following snippet allows you to display a button from your custom control and generate a script block on the client side to handle the click event.
public class CustomWebControl : WebControl { protected override void Render(HtmlTextWriter writer) { writer.Write(@""); this.Page.ClientScript.RegisterStartupScript(this.GetType(), "test-dialog-modal_1", @" "); } }Text to be displayed in the modal dialog.
This is the simple case of explaining how to achieve it.
The most overlooked advantage to owning a computer is that if they foul up, there's no law against whacking them around a little. ~Eric Porterfield.