Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 8th, 2004, 11:56 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default Message Box

Hi Guys

I am new to this website and forums, and hope that I will get a quick response. A simple question. I have created an interface which has fields asking for username and passwords, when the user clicks on the submit button, he is directed to the appropriate form.

But if the password is incorrect, how can I display a message box stating that "Username/password" incorrect like we do in VB 6.0 and VB.net

Thanks guys

__________________
Regards
Mike
 
Old August 9th, 2004, 07:44 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Are we taking windows or web? For windows, use Messagebox.Show(), althought MsgBox is still available.

For web, you need to use javascript alert() method or vbscripts msgbox() method. When you need to display a message, you can display with RegisterStartupScript at the server level. Here's another thread discussing this:

http://p2p.wrox.com/topic.asp?TOPIC_...rstartupscript

Brian
 
Old August 9th, 2004, 08:14 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Here's a little VB.NET helper class I wrote some time ago that may be of some use:

Public Class PageHelpers

    Public Shared Sub MsgBox(ByVal objPage As System.Web.UI.Page, ByVal strMessage As String)
        strMessage = strMessage.Replace("'", "\'").Replace(Convert.ToChar(10), "\n").Replace(Convert.ToChar(13), "")
        Scriptlet(objPage, String.Format("alert(""{0}"");", strMessage))
    End Sub

    Public Shared Sub Scriptlet(ByVal objPage As System.Web.UI.Page, ByVal strScriptlet As String)
        Static intScriptletCount As Integer = 0
        Dim strFullScript As String
        intScriptletCount += 1
        strFullScript = String.Format("<script language=""JavaScript"">{0}</script>", strScriptlet)
        objPage.RegisterStartupScript(String.Format("Scrip tlet_{0}", intScriptletCount), strFullScript)
    End Sub

End Class

Peter
-------------------------
Work smarter, not harder





Similar Threads
Thread Thread Starter Forum Replies Last Post
Message box basie Classic ASP Basics 1 September 4th, 2008 01:09 PM
Message box in C# shikha09 C# 0 November 28th, 2006 01:24 AM
how to use message box? andy hee ASP.NET 1.0 and 1.1 Basics 1 April 18th, 2006 04:53 AM
message box nalla ASP.NET 2.0 Professional 4 December 23rd, 2005 03:00 AM
Yes No Message box dbartelt Access 7 October 28th, 2005 08:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.