Frage

I have the following code which executes the C# onclick event.

<asp:LinkButton ID="LinkButton4" runat="server" onclick="LinkButton4_Click1">Apply Filter</asp:LinkButton>

I would also like to add a javascript onclick event to happen following this of

setVisible('cfilterpopup');

Basically I need it to store some information from the page when LinkButton4_Click1 happens and then setVisible sets an area of my page back to hidden because they entered that information and don't need to see it again.

What is the correct syntax to get both the C# onclick and the javascript onclick together. I'm looking for something like this but I know this is wrong

<asp:LinkButton ID="LinkButton4" runat="server" onclick="LinkButton4_Click1;setVisible('cfilterpopup')">Apply Filter</asp:LinkButton>
War es hilfreich?

Lösung

you need to use onclient click

<asp:Button OnClientClick="String" />

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.onclientclick(v=vs.110).aspx

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top