Javascript in ascx file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matthew Nace

    Javascript in ascx file

    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.
  • David Waz...

    #2
    Javascript in ascx file

    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.Attri butes("OnClick" ) = "return confirm('Ok to
    delete?');"

    [color=blue]
    >-----Original Message-----
    >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 i[/color]

    Comment

    Working...