OnServerClick not working

The event just doesn’t shoot, what am I missing?

Code for the button:

<input type="button" class="button hide" id="savetext" style="float:right;" value="Hello" runat="server" OnServerClick="savetext_Click"/> 

and the generated code (i.e. when opened in the browser and in the initial state):

 <input onclick="__doPostBack('ctl00$Main$savetext','')" name="ctl00$Main$savetext" type="button" id="savetext" style="float:right;" class="button hide" value="Save to text" /> 

I have <pages clientIDMode="Static" /> in web.config , but the name and the generated onclick event, despite this, have a prefix.

Server Side Code:

 Protected Sub savetext_Click(ByVal sender As Object, ByVal e As System.EventArgs) End Sub 

To be clear, my goal is to register a click on a button on the server side, and not just on the client side. Thanks.

+1
source share
1 answer

Maybe javascript error stops working ...

Well, I say, because they only reason that it stops working, there was a javascript error from the code that I see.

0
source share

All Articles