Jacque Scott
asked on
c# LinkButton OnClientClick
I have a DropDownList box where the user can select the year they would like to copy.
I have a LinkButton and when the user clicks it I first need to check if they want to continue. I use the following:
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:
Any ideas?
Year: <asp:DropDownList ID="yrl" runat="server" OnSelectedIndexChanged="LoadHolidaysExceptions" AutoPostBack="true"></asp:DropDownList>
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>
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"] + '.'); "
Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER