Link to home
Start Free TrialLog in
Avatar of Jacque Scott
Jacque ScottFlag for United States of America

asked on

c# LinkButton OnClientClick

I have a DropDownList box where the user can select the year they would like to copy.
Year: <asp:DropDownList ID="yrl" runat="server" OnSelectedIndexChanged="LoadHolidaysExceptions" AutoPostBack="true"></asp:DropDownList>

Open in new window


I have a LinkButton and when the user clicks it I first need to check if they want to continue.  I use the following:
<asp:LinkButton ID="CopyHolidayLink" class="cssCopy" onClick="CopyHoliday" OnClientClick="return confirm('Coping holidays will replace all holidays next year with entries from the year selected.'); " runat="server">Copy Holidays to Next Year</asp:LinkButton>

Open in new window


If they confirm 'Yes' then the 'CopyHoliday' code is run.  On the OnClientClick I would like to take the year they selected in the dropdownlist and add that year to the wording in the LinkButton but I don't know how.  Something like this:
OnClientClick="return confirm('Coping holidays will replace all holidays next year with entries from the year ' + Request["yrl"] + '.'); " 

Open in new window


Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

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
Avatar of Jacque Scott

ASKER

Thank you for such a quick and easy to use response!!!