javascript messagebox use

Discussion in 'ASP .Net' started by JohnE, Sep 1, 2009.

  1. JohnE

    JohnE Guest

    Hello. I am using the quick and dirty javascript messagebox for
    instructional messages during certain events. Below is the setting up the
    messagebox. Then I use AlertMessageBox("The instructional information to the
    users here.") in different events. But there are times when the message can
    get long.

    private void AlertMessageBox(string message)
    {
    if (!string.IsNullOrEmpty(message))
    {
    Response.Write("<script type=\"text/javascript\"
    language=\"javascript\">");
    Response.Write("alert('" + message + "');");
    Response.Write("</script>");
    }
    }

    How do I get a second line, like a carriage return to create the next line?
    Sample or links are good.

    Thanks.
     
    JohnE, Sep 1, 2009
    #1
    1. Advertisements

  2. Howdy!

    \r is a carriage return (the r literally stands for "return") in JavaScript.

    William
     
    William Niver, Sep 1, 2009
    #2
    1. Advertisements

  3. JohnE

    JohnE Guest

    Just several other items I've tried. If I put \n or \r\n or \r inside the
    AlertMessageBox then the message does not show at all. The page will show
    without ever going past the alert.
    John
     
    JohnE, Sep 1, 2009
    #3
  4. JohnE

    JohnE Guest

    Thanks for the quick response. But it skips over the alert with out showing
    it. An example is AlertMessageBox("This is how I have tried getting the
    return to show a second line in the message box. \rBut it is not showing the
    alert.")

    As mentioned, I tried the \n, \r\n, and \r, but when I do, the message does
    not show. Puzzling. Because when I take out the return, the message shows
    in a long line.

    John
     
    JohnE, Sep 1, 2009
    #4
  5. JohnE

    Scott M. Guest

    Maybe I missed something, but I don't see the OP using the language
    attribtue, it looks like he was using the correct type attribute from the
    get go.

    -Scott
     
    Scott M., Sep 13, 2009
    #5
  6. JohnE

    Scott M. Guest

    Oh, now I see it on the second line (doh!).

    -Scott
     
    Scott M., Sep 13, 2009
    #6
  7. JohnE

    Scott M. Guest

    Actually it's \n, not \r (n for new line).

    -Scott
     
    Scott M., Sep 13, 2009
    #7
  8. JohnE

    Scott M. Guest

    I prefer top posting and will continue to do so.
     
    Scott M., Sep 13, 2009
    #8
  9. JohnE

    Scott M. Guest

    The content in the article you reference fall into two categories:

    1. Don't top post because the usenet doesn't like it.
    2. Don't top post because of our subjective reasoning.

    --------------------

    1. We've come a long way since the inception of the Usenet and loose rules
    designed for its implementation 20 years ago don't hold up as well today.

    2. I can make a counter point to each of the subjective reasons listed, but
    in short, I disagree that the majority of users prefer bottom posting and I
    outright find it ridiculous to have to scroll down just to see a reply from
    the last post. I will inline when the reply is lengthy, but I prefer top
    posting because if you are following the thread, you've already read all the
    other stuff that you are suggesting we put our reply below.

    Bottom line: to each his own. There is no verdict on this. Please don't
    try to enforce something that you are not responsible for and that there
    isn't a concensus on.

    -Scott
     
    Scott M., Sep 13, 2009
    #9
  10. JohnE

    Ed Murphy Guest

    This argument against bottom-posting has been raised many times before,
    but it's really an argument against failure to trim quoted text down to
    just the part you're replying to.

    Personally, I use Thunderbird with the QuoteCollapse add-on for Usenet
    and personal e-mail; for work e-mail, the culture leans overwhelmingly
    toward top-posting, so I follow suit unless clarity demands inline.
     
    Ed Murphy, Sep 15, 2009
    #10
  11. JohnE

    Scott M. Guest

    Or, they've already been reading the thread and don't have to scroll at all
    just to see the last tidbit added!

    Let go of the "When I was a kid, we used the Usenet like this..." mentality.
    If you don't like it, don't read it.

    But, PLEASE don't think for a moment that you are somehow the diffinitive
    word on how to post or that you have any kind of authority.

    I won't bitch when you bottom post (even though I don't like it) and you
    have no need to do so when others top post (and yes, there are MANY of us
    who prefer it).

    -Scott
     
    Scott M., Sep 15, 2009
    #11
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.