Friday, 15 March 2013

Generalised Confirmation Box in Asp.Net -



Generalised Confirmation Box in Asp.Net -

in 1 of interview have been asked question.

you have asp.net application 5 6 pages, every page contains @ to the lowest degree 2 button controls(i.e submit , cancel button). need add together confirmation on button in application.

the process should designed in such way not have phone call code on button click(either client or server side)

so please needful, how can accomplish same.

you can utilize multiple events single event handler. create event below.

private void button_click(object sender, system.eventargs e) { button b = (button) sender; label1.text = b.id; }

and set on button_click handlers

<asp:button id="buttonsave" onclick="button_click" runat="server" text="save" /> <br /> <asp:button id="buttoncancel" onclick="button_click" runat="server" text="cancel" />

in event handler, declare variable type matches controls raise event.assign first argument of event handler variable, casting appropriate type.

asp.net

No comments:

Post a Comment