LoginAuthenticate\JavaScriptFunction

G

gh

In the Login1_Authenticate event I check to see if the login is valid
and if it is I have a javascript function before the body tag in the
aspx file I want to call. When I try to call the function I get the
following error:

The name 'myFunction' does not exist in the current context login.aspx.cs

What am I missing?

TIA

protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{

if (dsLogin.Tables[0].Rows.Count == 1)
{
Login1.FailureText = "";
myFunction(dsLogin.Tables[0].Rows[0]["CONAME"].ToString());

}

}




The function in the aspx file

<script language="javascript" type="text/javascript">
function myFunction(Value)
{

window.parent.set_value(Value);
}
</script>
 
B

bruce barker

the server can not call client javascript. its just producing html that the
browser will display. you can render inline javascript that the browser will
execute. see ClientScriptManger.RegisterStartupScript

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top