msgbox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • win

    msgbox

    I'm using ASP.Net 2.0

    MsgBox("Are you sure to delete?", MsgBoxStyle.Que stion +
    MsgBoxStyle.OkC ancel, Page.Title.ToSt ring)

    The message box sometimes does not pop up on the top of the screen.
    Can I set the message box always on top of the screen?

    Thank you


  • Steven Cheng [MSFT]

    #2
    RE: msgbox

    Hi Win,

    From your description, you're using MsgBox api in ASP.NET web application
    to display some dialog box and want to control position of the dialog,
    correct?

    As for the "MsgBox" api, would you tell me which control or component are
    you using? So far based on my understanding, ASP.NET doesn't provide
    built-in support on displaying messagebox since the messagebox is displayed
    at client-side browser (generally use javascript to display it). I'm
    wondering are you using System.Windows. Forms namespace's class to show to
    message box? If this is the case, I'm afraid winform API is not supported
    to be used in ASP.NET web application since ASP.NET appliation is
    server-side application which is mostly running in a non-interactive
    process and the messagebox showed via winform api can not be seen by client
    user. The reason you may see it when you use Visual Studio's webtest
    server on local machine is because the web test server itself is a winform
    application(you can close the browser when the msgbox displayed to verify
    this, it is displayed by the webtest server process).

    In addition, in ASP.NET we normally use client script to display message
    box( alert javascript method). Here are some web articles introducing this:

    #Message Box in ASP.NET 2.0


    #Adding Client-Side Message Boxes in your ASP.NET Web Pages


    #ASP.NET Alerts: how to display message boxes from server-side code?

    ay-message-boxes-from-server-side-code.aspx

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    msdnmg@microsof t.com.

    =============== =============== =============== =====
    Get notification to my posts through email? Please refer to
    Gain technical skills through documentation and training, earn certifications and connect with the community

    ications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscripti...t/default.aspx.
    =============== =============== =============== =====
    This posting is provided "AS IS" with no warranties, and confers no rights.



    --------------------
    >From: "win" <a@a.com>
    >Subject: msgbox
    >Date: Fri, 23 May 2008 12:54:18 +0800
    >
    >I'm using ASP.Net 2.0
    >
    >MsgBox("Are you sure to delete?", MsgBoxStyle.Que stion +
    >MsgBoxStyle.Ok Cancel, Page.Title.ToSt ring)
    >
    >The message box sometimes does not pop up on the top of the screen.
    >Can I set the message box always on top of the screen?
    >
    >Thank you
    >
    >
    >

    Comment

    • win

      #3
      Re: msgbox

      Hi Steven

      I've created a gridview and it has a delete button on each row.
      "<asp:CommandFi eld ShowDeleteButto n="True" />".
      I want to pop up a messagebox to ask the user Yes/No to ensure to delete the
      data instead of directly deleted the record.
      Can you help me?

      Thanks a lot

      Win

      "Steven Cheng [MSFT]" <stcheng@online .microsoft.com¦ b¶l¥ó
      news:6bx8Z1JvIH A.4088@TK2MSFTN GHUB02.phx.gbl ¤¤¼¶¼g...
      Hi Win,
      >
      From your description, you're using MsgBox api in ASP.NET web application
      to display some dialog box and want to control position of the dialog,
      correct?
      >
      As for the "MsgBox" api, would you tell me which control or component are
      you using? So far based on my understanding, ASP.NET doesn't provide
      built-in support on displaying messagebox since the messagebox is
      displayed
      at client-side browser (generally use javascript to display it). I'm
      wondering are you using System.Windows. Forms namespace's class to show to
      message box? If this is the case, I'm afraid winform API is not supported
      to be used in ASP.NET web application since ASP.NET appliation is
      server-side application which is mostly running in a non-interactive
      process and the messagebox showed via winform api can not be seen by
      client
      user. The reason you may see it when you use Visual Studio's webtest
      server on local machine is because the web test server itself is a winform
      application(you can close the browser when the msgbox displayed to verify
      this, it is displayed by the webtest server process).
      >
      In addition, in ASP.NET we normally use client script to display message
      box( alert javascript method). Here are some web articles introducing
      this:
      >
      #Message Box in ASP.NET 2.0

      >
      #Adding Client-Side Message Boxes in your ASP.NET Web Pages

      >
      #ASP.NET Alerts: how to display message boxes from server-side code?

      ay-message-boxes-from-server-side-code.aspx
      >
      Sincerely,
      >
      Steven Cheng
      >
      Microsoft MSDN Online Support Lead
      >
      >
      Delighting our customers is our #1 priority. We welcome your comments and
      suggestions about how we can improve the support we provide to you. Please
      feel free to let my manager know what you think of the level of service
      provided. You can send feedback directly to my manager at:
      msdnmg@microsof t.com.
      >
      =============== =============== =============== =====
      Get notification to my posts through email? Please refer to
      Gain technical skills through documentation and training, earn certifications and connect with the community

      ications.
      >
      Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
      where an initial response from the community or a Microsoft Support
      Engineer within 1 business day is acceptable. Please note that each follow
      up response may take approximately 2 business days as the support
      professional working with you may need further investigation to reach the
      most efficient resolution. The offering is not appropriate for situations
      that require urgent, real-time or phone-based interactions or complex
      project analysis and dump analysis issues. Issues of this nature are best
      handled working with a dedicated Microsoft Support Engineer by contacting
      Microsoft Customer Support Services (CSS) at
      http://msdn.microsoft.com/subscripti...t/default.aspx.
      =============== =============== =============== =====
      This posting is provided "AS IS" with no warranties, and confers no
      rights.
      >
      >
      >
      --------------------
      >>From: "win" <a@a.com>
      >>Subject: msgbox
      >>Date: Fri, 23 May 2008 12:54:18 +0800
      >>
      >>I'm using ASP.Net 2.0
      >>
      >>MsgBox("Are you sure to delete?", MsgBoxStyle.Que stion +
      >>MsgBoxStyle.O kCancel, Page.Title.ToSt ring)
      >>
      >>The message box sometimes does not pop up on the top of the screen.
      >>Can I set the message box always on top of the screen?
      >>
      >>Thank you
      >>
      >>
      >>
      >

      Comment

      • Mark Rae [MVP]

        #4
        Re: msgbox

        "win" <a@a.comwrote in message
        news:OwoNxNLvIH A.524@TK2MSFTNG P05.phx.gbl...
        I've created a gridview and it has a delete button on each row.
        "<asp:CommandFi eld ShowDeleteButto n="True" />".
        I want to pop up a messagebox to ask the user Yes/No to ensure to delete
        the data instead of directly deleted the record.
        Can you help me?
        As Steven has already explained, server-side code runs on the server and
        client-side code runs on the client.

        MsgBox is a function found in VB Classic and VBScript.

        Although you can still use VBScript as a client-side language in ASP.NET,
        this is not recommended because it will work only in IE.

        Therefore, to achieve the functionality you require, you need to use
        client-side JavaScript.

        The JavaScript equivalents of MsgBox is alert();, confirm(); and prompt();


        E.g. to ask the user to confirm that they want to do something, you might
        use the following:

        <asp:Button ID="MyButton" runat="server" Text="Delete"
        OnClick="MyButt on_Click" OnClientClick=" return confirm('Are you sure?');" />



        --
        Mark Rae
        ASP.NET MVP


        Comment

        • Steven Cheng [MSFT]

          #5
          Re: msgbox

          Thanks for Mark's input.

          Hi Win,

          I think Mark has provided some good reference about popup javascript dialog
          in web page which can help you display the "confirm deleting" dialog for
          gridview. If you have any further specific questions, welcome to post here.

          Sincerely,

          Steven Cheng

          Microsoft MSDN Online Support Lead


          Delighting our customers is our #1 priority. We welcome your comments and
          suggestions about how we can improve the support we provide to you. Please
          feel free to let my manager know what you think of the level of service
          provided. You can send feedback directly to my manager at:
          msdnmg@microsof t.com.

          =============== =============== =============== =====
          Get notification to my posts through email? Please refer to
          Gain technical skills through documentation and training, earn certifications and connect with the community

          ications.
          =============== =============== =============== =====
          This posting is provided "AS IS" with no warranties, and confers no rights.
          --------------------
          >From: "Mark Rae [MVP]" <mark@markNOSPA Mrae.net>
          >References: <OMasbFJvIHA.55 80@TK2MSFTNGP04 .phx.gbl>
          <6bx8Z1JvIHA.40 88@TK2MSFTNGHUB 02.phx.gbl>
          <OwoNxNLvIHA.52 4@TK2MSFTNGP05. phx.gbl>
          >In-Reply-To: <OwoNxNLvIHA.52 4@TK2MSFTNGP05. phx.gbl>
          >Subject: Re: msgbox
          >Date: Fri, 23 May 2008 12:03:46 +0100
          >news:OwoNxNLvI HA.524@TK2MSFTN GP05.phx.gbl...
          >
          >I've created a gridview and it has a delete button on each row.
          >"<asp:CommandF ield ShowDeleteButto n="True" />".
          >I want to pop up a messagebox to ask the user Yes/No to ensure to delete
          >the data instead of directly deleted the record.
          >Can you help me?
          >
          >As Steven has already explained, server-side code runs on the server and
          >client-side code runs on the client.
          >
          >MsgBox is a function found in VB Classic and VBScript.
          >
          >Although you can still use VBScript as a client-side language in ASP.NET,
          >this is not recommended because it will work only in IE.
          >
          >Therefore, to achieve the functionality you require, you need to use
          >client-side JavaScript.
          >
          >The JavaScript equivalents of MsgBox is alert();, confirm(); and prompt();
          >http://www.google.co.uk/search?hl=en...252&q=JavaScri
          pt+alert+confir m&meta=
          >
          >E.g. to ask the user to confirm that they want to do something, you might
          >use the following:
          >
          ><asp:Button ID="MyButton" runat="server" Text="Delete"
          >OnClick="MyBut ton_Click" OnClientClick=" return confirm('Are you sure?');"
          />
          >
          >
          >
          >--
          >Mark Rae
          >ASP.NET MVP
          >http://www.markrae.net
          >
          >

          Comment

          • Steven Cheng [MSFT]

            #6
            Re: msgbox

            Hi Win,

            Do you still have any questions on this? If so, please don't hesitate to
            post here.

            Sincerely,

            Steven Cheng

            Microsoft MSDN Online Support Lead


            Delighting our customers is our #1 priority. We welcome your comments and
            suggestions about how we can improve the support we provide to you. Please
            feel free to let my manager know what you think of the level of service
            provided. You can send feedback directly to my manager at:
            msdnmg@microsof t.com.

            --------------------
            >Organization : Microsoft
            >Date: Mon, 26 May 2008 02:14:29 GMT
            >Subject: Re: msgbox
            >Thanks for Mark's input.
            >
            >Hi Win,
            >
            >I think Mark has provided some good reference about popup javascript
            dialog
            >in web page which can help you display the "confirm deleting" dialog for
            >gridview. If you have any further specific questions, welcome to post here.
            >
            >Sincerely,
            >
            >Steven Cheng
            >
            >Microsoft MSDN Online Support Lead
            >
            >
            >Delighting our customers is our #1 priority. We welcome your comments and
            >suggestions about how we can improve the support we provide to you. Please
            >feel free to let my manager know what you think of the level of service
            >provided. You can send feedback directly to my manager at:
            >msdnmg@microso ft.com.
            >
            >============== =============== =============== ======
            >Get notification to my posts through email? Please refer to
            >http://msdn.microsoft.com/subscripti...ault.aspx#noti
            f
            >ications.
            >============== =============== =============== ======
            >This posting is provided "AS IS" with no warranties, and confers no rights.
            >--------------------
            >>From: "Mark Rae [MVP]" <mark@markNOSPA Mrae.net>
            >>References: <OMasbFJvIHA.55 80@TK2MSFTNGP04 .phx.gbl>
            ><6bx8Z1JvIHA.4 088@TK2MSFTNGHU B02.phx.gbl>
            ><OwoNxNLvIHA.5 24@TK2MSFTNGP05 .phx.gbl>
            >>In-Reply-To: <OwoNxNLvIHA.52 4@TK2MSFTNGP05. phx.gbl>
            >>Subject: Re: msgbox
            >>Date: Fri, 23 May 2008 12:03:46 +0100
            >
            >>news:OwoNxNLv IHA.524@TK2MSFT NGP05.phx.gbl.. .
            >>
            >>I've created a gridview and it has a delete button on each row.
            >>"<asp:Command Field ShowDeleteButto n="True" />".
            >>I want to pop up a messagebox to ask the user Yes/No to ensure to
            delete
            >>the data instead of directly deleted the record.
            >>Can you help me?
            >>
            >>As Steven has already explained, server-side code runs on the server and
            >>client-side code runs on the client.
            >>
            >>MsgBox is a function found in VB Classic and VBScript.
            >>
            >>Although you can still use VBScript as a client-side language in ASP.NET,
            >>this is not recommended because it will work only in IE.
            >>
            >>Therefore, to achieve the functionality you require, you need to use
            >>client-side JavaScript.
            >>
            >>The JavaScript equivalents of MsgBox is alert();, confirm(); and prompt();
            >>http://www.google.co.uk/search?hl=en...B252&q=JavaScr
            i
            >pt+alert+confi rm&meta=
            >>
            >>E.g. to ask the user to confirm that they want to do something, you might
            >>use the following:
            >>
            >><asp:Button ID="MyButton" runat="server" Text="Delete"
            >>OnClick="MyBu tton_Click" OnClientClick=" return confirm('Are you sure?');"
            >/>
            >>
            >>
            >>
            >>--
            >>Mark Rae
            >>ASP.NET MVP
            >>http://www.markrae.net
            >>
            >>
            >
            >

            Comment

            Working...