Results 1 to 8 of 8

Thread: Javascript alert() function

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    Javascript alert() function

    can you use a Javascript alert() function when using a web form control?

  2. #2
    Fanatic Member Patoooey's Avatar
    Join Date
    Aug 2001
    Location
    New Jersey, USA
    Posts
    774

    Re: Javascript alert() function

    Originally posted by EyeTalion
    can you use a Javascript alert() function when using a web form control?
    <asp:HyperLink id="HyperLink1" runat="server" NavigateUrl='javascript:alert("test");'>HyperLink</asp:HyperLink>


    John

  3. #3
    Lively Member
    Join Date
    Jul 2002
    Location
    Gateshead, UK
    Posts
    101

    Hold up!

    That would work fine - just make sure that you type "javascript:", and not "java script" - the space would not be valid, I think.
    Last edited by trojjer; Sep 27th, 2002 at 05:58 PM.
    <% Session("OwNeD")=True %><html><body>Blah... <%="Now get your ass back to the twilight zone..."%></body></html>

  4. #4
    Lively Member
    Join Date
    Jul 2002
    Location
    Gateshead, UK
    Posts
    101

    Huh?!

    Why is "javascript" appearing with an extra space, in that post? I've edited it again, but it still sticks to "java script", even when there's absolutely no space in between...
    <% Session("OwNeD")=True %><html><body>Blah... <%="Now get your ass back to the twilight zone..."%></body></html>

  5. #5
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    The forum software does that so that people cant try to stick malicious javascript into forum posts.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  6. #6
    Lively Member
    Join Date
    Jul 2002
    Location
    Gateshead, UK
    Posts
    101

    Oh I see...

    I think I know what you mean now - like a sneaky javascript URL or something?

    P.S: Ah - so it only insterts the space if the "javascript" is in quotes... got it.

    P.P.S: I wonder if single quotes catch it out or not... testing: 'javascript'...

    P.P.P.S: No - that doesn't get filtered through - very weird... must only happen occasionally; ie it's not 100% js exploit-proof?
    Last edited by trojjer; Sep 28th, 2002 at 07:55 PM.
    <% Session("OwNeD")=True %><html><body>Blah... <%="Now get your ass back to the twilight zone..."%></body></html>

  7. #7

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    thanks guys...one more question. How do you create a msgbox in ASP.NET if you are coding in the VB code behind page? I'm doing some validations on a click event...

  8. #8
    Lively Member
    Join Date
    Jul 2002
    Location
    Gateshead, UK
    Posts
    101

    Client permissions only...

    Erm - the MsgBox function can only execute on the clientside, obviously... I don't know about ASP.NET tags, but I usually just Response.Write the client VBS code, after processing it on the serverside.
    <% Session("OwNeD")=True %><html><body>Blah... <%="Now get your ass back to the twilight zone..."%></body></html>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width