473,381 Members | 1,450 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,381 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";
  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 7519

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

Similar topics

4
by: Fred | last post by:
I have read and tried every combination for hours. I'm sorry, but I don't get it. How do I have a form with textboxes and buttons and allow click events to execute a server function then display...
1
by: Jonatan | last post by:
Hi all, I'm trying to upload files doing something like gmail. I almost got it but I have a problem when I post the form. Basicaly, I am doing the following. When the user presses the link...
7
by: kai | last post by:
Hi, All I am trying to pop a message box in ASP.NET using JavaScript when I click a button, but I realize the JavaScript works for HTML control button do not work for ASP button. Any idea how...
2
by: Mike Moore | last post by:
asp.net app - How do you get Java-side code to communicate with server-side code? I have tried numerous ways and examples, but have been unsuccessful. Therefore, unless I get real lucky and find...
6
by: tshad | last post by:
I am trying to set up a Javascript popup box that has a way of sending back a message to asp.net on how to process some data. At the moment I am just doing: ...
1
by: asad | last post by:
Hello, i'm working on a greeting card website, there is a page where i'm showing greeting cards, i have done paging on this page with using Datalist and its working well but i have a problem is...
11
by: cindy | last post by:
I have a form, has javascript registered so a modal pops up. Button click will close form. Now I need to do an update with modal form data before it closes. I can put a second button and register...
5
by: ns21 | last post by:
How can the browser back button be disabled If the form is submitting information to other pages or submitting to itself or using redirections. I tried the tweaks like history.forward(1) in each...
7
by: Tony Girgenti | last post by:
Hello. I'm developing and testing a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2 computer. I'm using a web form. I'm...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.