문제

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>
도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top