473,505 Members | 15,036 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

message box used in vb.net code for asp.net web application gives error

10 New Member
i have created web application in asp.net using visual studio 2010.
i did coding in vb.net.
in vb.net code i used simple message box.
it does not give error when i run project through visual studio but when i deploy project using internet information services it gives error when message box should pop up.
message box is simple as follows
Expand|Select|Wrap|Line Numbers
  1. msgbox("UPDATED")
  2.  
Aug 15 '14 #1
3 11835
Frinavale
9,735 Recognized Expert Moderator Expert
It is not advisable VB.NET Message Box in web applications.

In web applications there is server-side code that processes requests (This is your VB.NET code) and there is client side code which is run in the web browser (this includes HTML, CSS and JavaScript).

The server side code generates the client side code, the client-side code operates separately in the browser and then sends requests back to the server.

The message box control that you are looking to use should be done at a browser level and so it requires client-side functionality.

The VB.NET "MessageBox" control cannot help you since the VB.NET code is executed on the server.

You need to include JavaScript in the HTML that the VB.NET code generates to use the JavaScript alert('message') functionality to display a message box in the web development world.

-Frinny
Sep 8 '14 #2
rahul2310
62 New Member
Thanks Frinavale for your reply
msgbox was not giving error before deployment,it was working well while testing web app using view in browser.
But now i understood client and server side well
I replaced message box with below code and it works well for me.
Expand|Select|Wrap|Line Numbers
  1. Response.Write("<script type='text/javascript'>alert('---MY message -----');</script>")
  2.  
  3.  
Sep 9 '14 #3
Frinavale
9,735 Recognized Expert Moderator Expert
Looks good but be careful about putting that in your server side code.

When you use Response.Write in your server code sometimes it gets inserted into the generated output outside of the html (like before the <HTML> begin tag).

It's best to use Response.Write within your ASP code instead.

Or, if you need to do server operations you could use the Page.REgisterClientScriptBlock Method if you aren't using AJAX or the ScriptMnaager class if you are using AJAX.

-Frinny
Sep 11 '14 #4

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

Similar topics

8
2291
by: eje | last post by:
IsNumeric(value) should return false if value "can not be successfully converted to a Double." Instead I get the following error message: "Input string was not in a correct format." I use the...
1
1926
by: Krunom Ancini | last post by:
Hi... Im searching for free asp.net web-host (that supports c# code-behind) and i found one: on www.brinkster.com... And whats the problem? My web-application works fine on my machine but when...
5
2770
by: Ken Cox [Microsoft MVP] | last post by:
MS has posted this here: http://www.asp.net/faq/ms03-32-issue.aspx Fix for: 'Server Application Unavailable' Error after Applying Security Update for IE...
0
1391
by: Umair Ahmed | last post by:
Hi, I m developing a web application on Win2k platform and deploying the application on Win2k platform. I didnt get any error on the development machine but when i deployed to any machine on...
5
2091
by: Kim Nørby Andersen | last post by:
Hello there I am lost. i receive the output in the bottom, from a site that runs excellently on our development server, but dies on the customer. We have had a first version running at the...
6
1944
by: vips | last post by:
Page_Load datagrid1.datasource=dataset1 //I am filling the datagrid and it works fine when page is displayed end ---------------
3
3984
by: jbrumbau | last post by:
Hello, I am trying to refer to fields on a given form from the form query's recordset, essentially from the following commands: Dim frm As Form 'Refers to the current form Dim tagName...
2
1616
by: kkshansid | last post by:
I dragged text box and write in data/control source = & "," & Chr$(13) & Chr$(10) & & Chr$(13) & Chr$(10) & but it gives error that #name? in layout view kindly help to resolve the problem...
6
1367
topher23
by: topher23 | last post by:
I have an Access subroutine that needs to generate an Excel spreadsheet for accounting. I've used late-bound Excel automation before, but for some reason I keep running into a strange issue when I...
0
1033
by: rahulsankhe1089 | last post by:
I am using below javascript <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script> <script type="text/javascript"> ...
0
7216
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
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...
0
7303
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,...
0
7367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5613
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1528
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 ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
407
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...

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.