Possible Duplicate:
Call c# function in javascript
I have a c# function containing an if statement (if (condition) test=true else test= false )), Can anyone tell me how to call that function in javascript and use the result of that test variable to do an if statement.
The c# file I am referencing is the code behind (.aspx.cs) to an .aspx page. Is there not a way I can call the following function from this .aspx page.
public void write(bool complete)
{
System.IO.StreamWriter writer = new System.IO.StreamWriter(Server.MapPath("~file.txt"), true);
if (complete == true)
{
writer.WriteLine("completed");
}
else
{
writer.WriteLine("FAILED");
}
writer.Flush();
writer.Close();
writer.Dispose();
}