c# - unregister client script from Asp.Net -
i register jquery ui datepicker in asp.net page using .net scriptmanager
class.
private void registerdatepicker(textbox tb) { if (tb != null) { scriptmanager.registerstartupscript(this, typeof(page), "registerdatepicker" + tb.id, "registerdatepicker('" + tb.clientid + "');", true); } }
so once registered, want unregistered script page. how can ?
thanks
after @stackoverflowexception answer,
the reason want unregister script is, have few textbox
controls created dynamically , hooked date picker. not datepicker registered,a dialog , validator scripts registered. script becoming bigger , bigger in page. once used control, if no longer use control want remove associated registered script.
note controls created , added in table
thanks again.
jquery makes simple (and compactly) shouldn't on server-side (if understand you're doing).
just add class (like date-picker
) text boxes should use date pickers, put single line of code on html page:
$('date-picker').datepicker();
every suitable textbox on page use jquery datepicker
.
Comments
Post a Comment