473,320 Members | 1,870 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,320 software developers and data experts.

How to Display Message Box on Screen while using Asp.net with C# ?

Hi ! Guys,
I have no idea about How to Display Message Box on Screen while using Asp.net with C# ? Help Me.
Thanks in advance...
Jun 25 '08 #1
1 1969
Curtis Rutland
3,256 Expert 2GB
Can't do it with ASP.NET. Remember, ASP.NET is a Server Side technology. Javascript is really your only hope.

There is a way to get confirmation on a button press, though. I'm not sure if it is what you need, but here it is if it helps you.
Expand|Select|Wrap|Line Numbers
  1. <!-- aspx file -->
  2. <asp:Label ID="lConfirmed" runat="server" Text="Not Confirmed" /><br />
  3. <asp:Button ID="bConfirm" runat="server" Text="Confirm?" 
  4.     OnClientClick="return confirm('Are you sure?');"
  5.     OnClick="bConfirm_Click" />
  6.  
Expand|Select|Wrap|Line Numbers
  1. //.aspx.cs file
  2. protected void bConfirm_Click(object sender, EventArgs e)
  3. {
  4.     lConfirmed.Text = "Confirmed";
  5. }
  6.  
This will run the javascript in the OnClientClick, and if it returns true, run the server code. Else, cancel the postback.
Jun 25 '08 #2

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

Similar topics

4
by: Nicolla MacPherson | last post by:
Hi I'm a newbie and want to display a pattern that will increment with each line of display. I thought i might be able to count the rows and use that info to increment my display. I've got my...
5
by: Tobierre | last post by:
Hi All, In a web page I have created I have included a .js file in the body section of the page with the below JavaScript code. The code works fine, but creates an extrra blank line at the...
17
by: kimimaro | last post by:
How do you limits employee display where you enter the department for all the employee within that department be displayed and if lets say they are 100 or so and you have to limits 10 employee per...
5
by: hayworth | last post by:
How do I get the color depth of the screen/display adapter with vb.net 2003? Background: We're having transparency problems (long side story and known Windows "bug") that requires our systems to...
5
by: Hoss | last post by:
Hello all, Ill try and make this short and sweet. I have the following Javascript being executed when the user clicks a button function myFunc() { -- Get some values from elements on the...
7
by: Simon Wigzell | last post by:
I am putting together a website for a photographer. There will be a section where his clients can select various sizes of picture to order. I would to be able to display the images the actual size...
1
by: Ted Ngo | last post by:
Hi All, I try to create a login screen using mode="Forms" Web Config: <authentication mode="Forms"> <forms name=".ASPXAUTH" loginUrl="Login.aspx" protection="All" timeout="30" path="/"
8
by: nickyeng | last post by:
I have written 3 files, i dont know whether i do it correctly or wrongly but somehow it compiled well and can run. My simple aim is to display the terrain.txt file into the terrain array, and then...
9
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo"...
0
by: adubra | last post by:
Hi there, I am using a device context (DC) and a buffer to successfully draw to screen. However, when I update the DC at very high frame rate and drag the frame containing the image very quickly...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.