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.
Radu
source share