473,508 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

LoginAuthenticate\JavaScriptFunction

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>
Jun 27 '08 #1
1 1028
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)
"gh" wrote:
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>
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.