469,300 Members | 2,311 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,300 developers. It's quick & easy.

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";
  2.  
  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)
  2.  
  3. {
  4.  
  5. How can I display a message box from this section of the code with Yes and No buttons.
  6.  
  7. LinkButton linkButton = (LinkButton)sender;
  8.  
  9. string id - linkButton.ID;
  10.  
  11.  
  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 7320

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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.