can you use a Javascript alert() function when using a web form control?
Printable View
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>Quote:
Originally posted by EyeTalion
can you use a Javascript alert() function when using a web form control?
John
That would work fine - just make sure that you type "javascript:", and not "java script" - the space would not be valid, I think.
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...
The forum software does that so that people cant try to stick malicious javascript into forum posts.
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?
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...
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.