473,748 Members | 2,670 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

26 New Member
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 2000
Curtis Rutland
3,256 Recognized Expert Specialist
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
4760
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 starting point using setw and don't want to use cout for every line of display. What should i be looking for to use. Thanks
5
1847
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 bottom of the web page! Does anyone know why this is happening? Any help kindly appreciated Tobierre
17
2217
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 page before entering anything to display the next 10 again?
5
4699
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 have the Color Depth or "Color Quality" (bits per pixel) of the display adapter (screen) to be 16 bits (Called "Medium (16 bit)" in the Display Properties Control Panel) in order for it to work.
5
2002
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 page -- Send those values to the server using Ajax and retrieve a
7
2673
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 depending on the clients screen size and resolution. Is this possible? I know that the server receives info on the resolution of the client computer, but that isn't quiet enough if you don't know the size of their monitor. OR the pixels per inch w...
1
5736
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
2212
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 display terrain into screen. I can't display the whitespace characters from terrain.txt file to screen. and It display "weird"( the red color part). http://i19.photobucket.com/albums/b171/NickyEng/display.jpg I tried searching one line by...
9
2593
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" runat="server"/> <asp:Label ID="CompanyPicture" runat="server"/> I have 2 links that open the windows to preview these images. The previewed images are done on separate html pages that do nothing but display the
0
2468
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 over the screen or I drag another window on top of the fast display, I get errors (Pyassertion ....). I believe those are related to a conflict between the thread that is updating the buffer (over which I have control) and the thread that is doing the...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9561
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.