Link to home
Start Free TrialLog in
Avatar of WingYip
WingYip

asked on

Linkbutton server and client events

csharp asp.net 4
I have a linkbutton.

On click I insert some values into a database on server but on the client side I need to open a PDF file in a new window.

How can I achieve this?

Wing
Avatar of JosephEricDavis
JosephEricDavis

There are server side events and client side events for the linkbutton.

<asp:LinkButton runat="server" ID="lnkButton1" OnClick="ServerSideMethod" OnClientClick="ClientSideMethod" Text="Click Me"></asp:LinkButton>

On the Server side you can do any server side processing you need, and then in the OnClientClick attribute, you give it the name of the javascript function you would like to call.  Have that javascript function open your pdf in a new window.
ASKER CERTIFIED SOLUTION
Avatar of JosephEricDavis
JosephEricDavis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial