C
cider123
Here's a quick snapshot of the top few lines of the aspx page:
<%@ Page Language="C#" MasterPageFile="~/Master1.master"
AutoEventWireup="true" CodeFile="TestPage.aspx.cs" Inherits="TestPage"
Title="Test Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cpMain"
Runat="Server">
<script type="text/javascript">
function fnOpen(){
<%
DoSomething();
%>
}
</script>
<table style="width: 100%">
....
I have the function calling a code behind routine, and that works just
fine when I want it to (button click on form).
I was puzzled at first, thinking the button was getting triggered on
page load.. but I removed all references, searched the project and no
other references to "fnOpen()" exist except this snapshot you see
above.
Ideally it should never fire because nothing is calling it. However,
it fires every time the page is loaded.
How do you make it so the function is only executed when you click the
button?
I'm working with ASP.NET 2.0 in Visual Studio 2005.
The only place it exists is in this one Web Form I have in the project.
<%@ Page Language="C#" MasterPageFile="~/Master1.master"
AutoEventWireup="true" CodeFile="TestPage.aspx.cs" Inherits="TestPage"
Title="Test Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cpMain"
Runat="Server">
<script type="text/javascript">
function fnOpen(){
<%
DoSomething();
%>
}
</script>
<table style="width: 100%">
....
I have the function calling a code behind routine, and that works just
fine when I want it to (button click on form).
I was puzzled at first, thinking the button was getting triggered on
page load.. but I removed all references, searched the project and no
other references to "fnOpen()" exist except this snapshot you see
above.
Ideally it should never fire because nothing is calling it. However,
it fires every time the page is loaded.
How do you make it so the function is only executed when you click the
button?
I'm working with ASP.NET 2.0 in Visual Studio 2005.
The only place it exists is in this one Web Form I have in the project.