Home > Mobile >  Execute the function I wrote in C # by changing the value (input)
Execute the function I wrote in C # by changing the value (input)

Time:02-27

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;
}

enter image description here

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.

  • Related