anass 90 anass 90 - 1 month ago 6x
ASP.NET (C#) Question

Calling 2 functions using asp:linkButton

I need to call 2 functions in the onclick using the LinkButton control, it cannot execute the javascript Function :

<asp:LinkButton ID="btnVirement" value="virement" runat="server" style="color: #f15d22;" onclick="CatchLinkVirement();btnVirement_Click" ><u><b>Comment effectuer un virement ?</b></u></asp:LinkButton>

and this is the CatchLinkVirement() javaScript function :

function CatchLinkVirement() {

var pLinkVirement = document.getElementById("btnVirement").value;
sessionStorage.setItem("pClickVirement", pLinkVirement);

and this is my codebehind :

public void btnVirement_Click(object sender, EventArgs e)
HttpContext.Current.Session["BonSavoirPopup"] = "BonAsavoirVirement";


Div Div

You can try like this:

OnClick="btnVirement_Click" OnClientClick="return CatchLinkVirement();"