| | |
Can I use Msgbox function in ASP.NET ?
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2009
Posts: 41
Reputation:
Solved Threads: 1
hi guys
I have heard that for displaying message we generally use MSGBOX function in VB.NET and
we use ScriptManager.RegisterStartscript in ASP.NET to display message box...
but I have tried to use Msgbox function in ASP.NET and it works here also...
So is it ok to use Msgbox function in websites to display message or
there are some problems or issues related to it?
If yes then pls let me know..
I have heard that for displaying message we generally use MSGBOX function in VB.NET and
we use ScriptManager.RegisterStartscript in ASP.NET to display message box...
but I have tried to use Msgbox function in ASP.NET and it works here also...
So is it ok to use Msgbox function in websites to display message or
there are some problems or issues related to it?
If yes then pls let me know..
No you can't. You need to use a client side
http://www.eggheadcafe.com/articles/20041016.asp
alert() with javascript. You can read about client side events here:http://www.eggheadcafe.com/articles/20041016.asp
Actually here is an example with an alert on a server side control. This will cause an alert then a postback:
Page:
Code behind:
Page:
ASP.NET Syntax (Toggle Plain Text)
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Alerter.aspx.cs" Inherits="daniweb.web.Alerter" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Button ID="Button1" runat="server" Text="Button" /> </div> </form> </body> </html>
Code behind:
ASP.NET Syntax (Toggle Plain Text)
using System; namespace daniweb.web { public partial class Alerter : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Button1.Attributes.Add("onclick", "javascript:alert('hello');"); } } }
•
•
Join Date: Jul 2009
Posts: 41
Reputation:
Solved Threads: 1
ya i know that we should use alert function to display client side script in asp.net
but
i have msgbox function in my website and when I RUN the webpage it gives no error ..it works fine... ..
I want to know will that will it problems in real time deployment..??
I my PC that page runs well with MSGBOX function... but will it cause problems in realtime when website will be deployed to SERVER?
but
i have msgbox function in my website and when I RUN the webpage it gives no error ..it works fine... ..
I want to know will that will it problems in real time deployment..??
I my PC that page runs well with MSGBOX function... but will it cause problems in realtime when website will be deployed to SERVER?
•
•
•
•
ya i know that we should use alert function to display client side script in asp.net
but
i have msgbox function in my website and when I RUN the webpage it gives no error ..it works fine... ..
I want to know will that will it problems in real time deployment..??
I my PC that page runs well with MSGBOX function... but will it cause problems in realtime when website will be deployed to SERVER?
'hey sknake,can u tell me one thing,that instead of writing Button1.Attributes.Add("onclick", "javascript:alert('hello');"); on button click event,Y we write it in Page Load event! '
This is used in the form load so that the Javascript is applied to the control once the form loads, otherwise this will only be applied to the control once you click on a button , therefore you will have to click the button twice.
1. to apply the JavaScript
2. to fire the javaScript
This is used in the form load so that the Javascript is applied to the control once the form loads, otherwise this will only be applied to the control once you click on a button , therefore you will have to click the button twice.
1. to apply the JavaScript
2. to fire the javaScript
Delphi & C# programmer deluxe...
![]() |
Similar Threads
- Looking for Sr. ASP .NET Developers (Software Development Job Offers)
- ASP.NET/SQL Developer/Programmer (Web Development Job Offers)
- ASP.Net perm full time programmer wanted (Web Development Job Offers)
- Front-End Developer with ASP.net needed!!! (Web Development Job Offers)
- Experience ASP.net with C# developer needed!! (Web Development Job Offers)
- ASP.Net / C# Web Developer (Web Development Job Offers)
- How to encrypt using the MS ASP.NET inbuilt function for cryptography.. (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Dropdownlist_SelectedIndexChanged
- Next Thread: what is the code to perform signout in C#
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox class click commonfunctions compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock deployment development dgv dropdownlist dropdownmenu dynamic edit embeddingactivexcontrol expose findcontrol flash flv formatdecimal forms formview gridview homeedition iframe iis javascript jquery list login menu microsoft mono mssql multistepregistration nameisnotdeclared numerical objects order panelmasterpagebuttoncontrols problem ratings rotatepage save schoolproject search security serializesmo.table silverlight smartcard sql sqlserver2005 ssl suse textbox tracking unauthorized validation vb.net video virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webdevelopment webservice wizard xml youareanotmemberofthedebuggerusers






