Click to See Complete Forum and Search --> : How to check if javascript has run in codebehind ( c# )?


Visslan
October 22nd, 2007, 04:50 AM
codeInfront:

<input type="button" onclick="JavaScript:clearSelections();" name="clear" value="Delete"/>


codeBehind:

public void Page_Init( object sende, System.EventArgs e )
{
if( ?input button has been klicked? )
{
.....
}
}


In my code behind I want to reset an object when the button has been klicked. But how can I see if that has happened?

PeejAvery
October 22nd, 2007, 08:03 AM
Remember that code behind is on the server-side. You will have to submit the page in order for information to go back to the server.

Are you attempting to reset HTML objects on the client-side, or server-side? If client-side, I would suggest using JavaScript instead.