#1
  1. unlink /usr/bin/*
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Location
    Vancouver, Canada
    Posts
    182
    Rep Power
    75

    Unhappy ASP.NET/VB Message Box


    I was looking a long time for a way to display a message box in ASP.NET/VB but i cant. SO can someone please tell me how i can display a message box using VB. I really need to know
    Thanks in advace
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    8
    Rep Power
    0
    hi

    if u r using asp.net try this out

    imports system.windows

    then type this code

    System.Windows.Forms.MessageBox.Show(.......


    hope this solve u'r problem

    bye
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    6
    Rep Power
    0
    I've never been able to use system.windows in an asp.net application, only in a vb.net windows application. If you want to display a message box only (i.e. not an input box), you can use a javascript alert box.

    Response.Write("<script>alert('Your password has been changed.')</script>")

    You can put this into a procedure in a code-behind module for a page eg. in a button click event.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    8
    Rep Power
    0
    hi

    actually 1st thing is that u need to add reference
    goto
    project menu -> add reference - > .net tab - >

    select this
    System.windows.Forms.dll

    then
    in coding part (.vb) type

    imports system.windows

    and finally in button click try the code.
    System.Windows.Forms.MessageBox.Show(.......

    u will surely get a message box. But this has few limitations.
    regards

    sriram
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2014
    Posts
    2
    Rep Power
    0
    'ASP.net MessageBox
    'Add a scriptmanager to the ASP.Net Page

    <asp:scriptmanager id="ScriptManager1" runat="server" />

    try:

    Dim sMsg As String = "My Message"

    ScriptManager.RegisterStartupScript(Page, Page.GetType, Guid.NewGuid().ToString(), "alert('" & sMsg & "')", True)


    Originally Posted by Ramihg
    I was looking a long time for a way to display a message box in ASP.NET/VB but i cant. SO can someone please tell me how i can display a message box using VB. I really need to know
    Thanks in advace

IMN logo majestic logo threadwatch logo seochat tools logo