Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Event for button(Webcontrol) and HtmlButton(HtmlControl)

  Asked By: Lacy    Date: May 12    Category: Sharepoint    Views: 1278

I have two controls in my webpart :
1. button(Webcontrol) and
2. HtmlButton(HtmlControl)

Both are getting rendered on the webpart.

The problem however is that button.click() function for button and
htmlbutton.serverclick() function for Htmlbutton is not being shown by
the intellisense of the VS IDE. (Error - click is not an event of

Hence i cannot write the event handlers. What can be the problem?



1 Answer Found

Answer #1    Answered By: Bhumi Gokhale     Answered On: May 12

First of all, when are your creating these controls?

They need to be created in an overridden CreateChildControls() method.

Then you need to create a new event  handler method i.e. button.Click += new

Then all the work of the event happens in the EventHandlerMethhodName()

Didn't find what you were looking for? Find more on Event for button(Webcontrol) and HtmlButton(HtmlControl) Or get search suggestion and latest updates.