hi,
I am running on asp.net core and calling the below script after click anchor link but its return error like local host not found
HTTP ERROR 404
function someFunction(file) {
window.open("/docs/" + file);
}
I ckecked my settings and do again ,but nothing change
my settings like below
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="~/twitter-bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<script src="~/jquery/jquery.min.js"></script>
<script src="~/twitter-bootstrap/js/bootstrap.bundle.min.js"></script>
</head>
<body class="hold-transition sidebar-collapse sidebar-mini" style="overflow-y: hidden">
<div class="mt-5" style="margin-left:700px">
<input type="button" value="Open" class="btn btn-primary ml-5" onclick="someFunction('a.txt')" id="btnOpen" name="btnOpen" />
</div>
</body>
</html>
<script type="text/javascript">
function someFunction(file) {
window.open("/docs/" + file);
}
</script>
// Startup
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseStaticFiles();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller}/{action}/{id?}");
});
}