anass 90 anass 90 - 1 year ago 94
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
Answer Source

You can try like this:

OnClick="btnVirement_Click" OnClientClick="return CatchLinkVirement();"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download