Javascript in ascx file

  • Thread starter Thread starter Matthew Nace
  • Start date Start date
M

Matthew Nace

Is there any limitations in using javascript in .ascx
files (user controls) I got it working just fine but some
of the properties for objects, ie form.item property isn't
coming up. In .aspx files everything is fine. I want to
set a boolean var, set that to a hidden html element, then
test it in the code-behind. I have attached the ascx file
for reference. Is there something I need to do.

What this is all coming down to is so I can have the user
confirm a deletion in the web site, and then test for the
boolean value. And since you can't use message boxes in
ASP.Net this is the root I'm taking. Thought if there is a
better solution in displaying a message box, I'm all ears,
thanks.
 
I personally think a better ROUTE is to add an on-click
event attribute to the control that uses a confirm message:

Code-behind:
btnDelete.Attributes("OnClick") = "return confirm('Ok to
delete?');"
 
Back
Top