now, the issue is, the above Java script function is not calling so, no alert message displays. May i know what would be the reason?
The design is not optimal. JavaScript code should exist in the parent page not a user control. Also Web Forms creates dynamic IDs so $("#MyHidden") is not the actual ID.
Anyway, the first step is debugging. Open the browser's dev tools and look for errors in the console. Fix the errors and re-test. Repeat until you fixed all the errors.
Next, use the dev tools debugger to single step through the code to find logical errors. Repeat until you fixed all the logical errors.
Member
297 Points
1356 Posts
java script not calling from user control
Nov 04, 2020 11:06 PM|winseealn@hotmail.com|LINK
im developing web form application project.
there i have a web form called WebForm1.aspx, this has WebUserControl1.ascx
WebUserControl1.ascx has WebUserControl2.ascx.
In WebUserControl2.ascx below is the html tags
now, the issue is, the above Java script function is not calling so, no alert message displays. May i know what would be the reason?
All-Star
53691 Points
24028 Posts
Re: java script not calling from user control
Nov 04, 2020 11:35 PM|mgebhard|LINK
The design is not optimal. JavaScript code should exist in the parent page not a user control. Also Web Forms creates dynamic IDs so $("#MyHidden") is not the actual ID.
Anyway, the first step is debugging. Open the browser's dev tools and look for errors in the console. Fix the errors and re-test. Repeat until you fixed all the errors.
Next, use the dev tools debugger to single step through the code to find logical errors. Repeat until you fixed all the logical errors.