I have an ASP.NET (c# codebehind) in which a simple <a> tag invokes a javascript function... Calling this function will produce an unwanted directory listing even if the javascript does absolutely nothing... Obviously it intended to do something, but I have boiled this down to the simplest possible code in an effort to figure out what is causing this problem and to provide an example demonstrating the problem for this thread...
How can I make this directory listing (or attempted directory listing) go away???
Here is the code that produces this problem:
Code:<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="GN3.WebForm1" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD> <title>How do I make this directory listing go away...</title> <meta name="vs_defaultClientScript" content="JavaScript"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> <script type="text/javascript"> function Preview() { // do absolutely nothing } </script> </HEAD> <body> <a href="" onclick="Preview()">Click here for an UNWANTED directory listing...</a> </body> </HTML>




Reply With Quote