How can I execute the function I wrote inside the c # code when I change the input value?
<input id="quantity2" runat="server" type="number" onserverclick="lod_gheymat" value="" min="1" max="20" />
protected void lod_Price(object sender, EventArgs e)
{
lbl_Plural.Text = quantity2.Value;
}
CodePudding user response:
Use a asp:Textbox instead of an input control with ‘runat=server’. Then set the property AutoPostback to true, and handle the event ‘OnTextChanged’.
See: https://meeraacademy.com/textbox-autopostback-and-textchanged-event-asp-net/ for an example.