calll html button onclick event from asp server side login authenticate event
Posted
by CraigJSte
on Stack Overflow
See other posts from Stack Overflow
or by CraigJSte
Published on 2010-01-30T18:05:22Z
Indexed on
2010/05/16
1:40 UTC
Read the original article
Hit count: 350
Need to programmatically click an html button from a login event (code behind? the html button sends variables to Flash using method: no response - with no postback and uses ExternalInterface API via javascript.
Going from SWF > ASPX is great, but need to send User.Identity to SWF from ASPX via javascript after authenticate with login event which am having impossible time getting to work... (calling HTML event from Login button) tried scripting in javascript to login event with no luck, possibly because postback clears SWF variables - so perhaps keeping separate (login then html send) would work...
Here is my relevant code:
function sendToActionScript(value) {
swfobject.getObjectById("Property").sendToActionScript(value);
}
</script>
<object ..// SWF File embedded> </object
<form id="form1" runat="server">
<asp:Login id="login1" OnAuthenticate="login1_Authenticate"/>
</form>
<form id="form" onsubmit="return false;">
<input type="text" name="input" id="input" value="" runat="server" />
<button id="btnInput"
runat="server"
causesvalidation="false"
visible="true"
style="width: 51px"
onclick="sendToActionScript(this.form.input.value);" >Send</button><br />
</form>
// CODE BEHIND
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
// do something to get User Id and Role
//bind the string (user or role) to input.value
//then call the HTML button onclick event to send it to SWF file.
//which I could put in separate function and call from Login_Authenticate
}
Can anyone help me I am out of ideas.
Craig
© Stack Overflow or respective owner