Error occur
-
Hi, I'm trying to ask a web button to fire an event in javascript which is called PrntPreview(). But when I run, it gave this error below: BC30456: 'PrntPreview' is not a member of 'ASP.DisplayStkCode_aspx'. Anyone can tell me wat is wrong? Thanks in advance, Chiari
-
Hi, I'm trying to ask a web button to fire an event in javascript which is called PrntPreview(). But when I run, it gave this error below: BC30456: 'PrntPreview' is not a member of 'ASP.DisplayStkCode_aspx'. Anyone can tell me wat is wrong? Thanks in advance, Chiari
Hi there, The
onclick
is the server side event of the button web control, so you need to provide the PrntPreview method which will be running at the server side, and you cannot assign a client side function to the event in the html editor. If you just want to add the client side function for the onlick event, you can do that as below://Assume the PrntPreview is a client side function.
btnPreview.Attributes.Add("onclick", "PrntPreview();"); -
Hi there, The
onclick
is the server side event of the button web control, so you need to provide the PrntPreview method which will be running at the server side, and you cannot assign a client side function to the event in the html editor. If you just want to add the client side function for the onlick event, you can do that as below://Assume the PrntPreview is a client side function.
btnPreview.Attributes.Add("onclick", "PrntPreview();");