I want to fire a server-side ASP.NET button click event in JavaScript. I checked the page source and the button's onclick in client side is:
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$LoginInfo1$btnliOK", "", true, "", "", false, false)); But I have to replace ctl00$LoginInfo1$btnliOK with something like <%= btnliOK.ClientName %>. Is there a way to do that?
You can get it using the Control.UniqueID Property
btnliOK.UniqueID UniqueID gives the on page rendered nameClientID gives the on page rendered idID give's the id that you can use on code behind
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With