Javascript in ascx file

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.
 
D

David Waz...

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?');"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top