I'm using ASP.Net 2.0. I have a custom control that is inherits from a 3rd-party vendor's control. I'm trying to override the Render method.
Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
if (some condition is true) then
Dim d As New Button()
d.RenderControl(writer)
else
MyBase.Render(writer)
end if
end sub
What I need is that under certain situations I want to be able to render a Button instead of the original control. But I want the Button to have the same client Id as the control so that I can use javascript to manipulate it.
How do I assign a clientid to the button? Thank you.