How can I Pass Mouse Click Event to JavaScript function from code behind.
imgTest.Attributes.Add("onclick", "javascript:return Test('" + sUrl + "','" + txtTest.ClientID + "','"
+ hdnTestId.ClientID + "');");
function Test(sUrl,TestName,TestId){
}
How can I Get Click Event Test JavaScript Function
I Have Try eventargument not worked Please Below Code
EventArgs e = new EventArgs();
imgTest.Attributes.Add("onclick", "javascript:return Test('" + sUrl + "','" + txtTest.ClientID + "','"
+ hdnTestId.ClientID + "','" + e + "');");
function Test(sUrl,TestName,TestId,EventArg){
}
Note :- I can't change Calling mechanism..
Well, if you wire up a client side event?
You can always drop in a button on the page - hide it with style="display:none"
<asp:Button ID="cmdRunServerCode" runat="server" Text="Button" style="display:none" ClientIDMode="Static" />
<script>
function mytest() {
// do whatever
// now run server side button code
$('#cmdRunServerCode').click()
}
</script>
So, you can use js to "click" the hidden button to run that button code stub you have server side.