471,616 Members | 1,962 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,616 software developers and data experts.

Add message box to a link button from server side code programatically using C#

I have added a LinkButton to the web page programatically from server side code using ASP 2.0 and C# in my Page_Load method. I also associate this LinkButton with a LinkButton_ClickHandler_Edit and write LinkButton_ClickHandler_Edit in my C# code.

I have coded linkbutton as:

Expand|Select|Wrap|Line Numbers
  1. LB1.Text = "Edit";
  3. LB1.Click += new System.EventHandler(LinkButton_ClickHandler_Edit);
Everything is fine as yet.

Now, I want to display a pop-up message box as "Do you want to continue" with two buttons as "Yes" and "No" in the message box from the server server side C# code programatically; when the user clicks on this Link button. If the answer is Yes, then I willcontinue with the remaining code and No will cancel it.

How can I add a message box to my link button from the server side code programatically?

The LinkButton_ClickHandler_Edit method is:

Expand|Select|Wrap|Line Numbers
  1. protected void LinkButton_ClickHandler_Edit(object sender, EventArgs e)
  3. {
  5. How can I display a message box from this section of the code with Yes and No buttons.
  7. LinkButton linkButton = (LinkButton)sender;
  9. string id - linkButton.ID;
  12. }
Do I have to do it by incorporating javascript in the server side code? If so, how?

Any help with code will be appreciated.
Dec 22 '06 #1
0 7402

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Jonatan | last post: by
7 posts views Thread by kai | last post: by
2 posts views Thread by Mike Moore | last post: by
6 posts views Thread by tshad | last post: by
1 post views Thread by asad | last post: by
5 posts views Thread by ns21 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.