Beginner Problems

Discussion in 'ASP General' started by simchajoy2000@yahoo.com, Jan 3, 2006.

  1. Guest

    Hi,

    This question will probably be too simplistic for all of you, but I am
    trying to teach myself asp and I am having all sorts of problems. I
    have a simple html form which calls process.asp on submit:

    <html>
    <head></head>
    <body>
    <form action="process.asp" method=Post>
    <table cellpadding="0" cellspacing="5" align=center>
    <tr>
    <td width="100"><font color="#1B157F">Name:</font></font></td>
    <td><input type="text" name="txtName" size="55"></td>
    </tr>
    </table>
    <input type="submit" name="Submit" value="Submit Now">
    </form>
    </body>
    </html>

    I want my process.asp page to display the name the user entered and
    then to send an email containing the information. Here is what I have
    so far for the process.asp page:

    <html>
    <head></head>
    <body>
    <%
    Dim strEmail

    Dim strName
    strName = Request.Form("txtName")
    Response.Write strName

    Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    MyCDONTSMail.From = ""
    MyCDONTSMail.To = ""
    MyCDONTSMail.Subject = "Get-A-Quote Request from " & strName
    MyCDONTSMail.Body = MyBody
    MyCDONTSMail.Send
    Set MyCDONTSMail = Nothing
    %>
    </body>
    </html>

    I am not trying to get this to run on a webserver at this point. I am
    just trying to get it run in a regular folder on my computer. I
    thought that might be the reason why I wasn't receiving any email but
    then the Response.Write doesn't work either. When I don't add the html
    tags I get a message that asks if I want to save or open the
    process.asp page instead of just running it.

    A little help? I'm obviously missing something . . . any advice would
    be greatly appreciated!

    Thank you!

    Joy
     
    , Jan 3, 2006
    #1
    1. Advertising

  2. Hi Joy,

    No, you're off to a fine start (aside from the fact that you're using 1990s
    technology...). But ASP files MUST be processed by a Web server. You can
    probably run this locally on your machine. What are the answers to these
    questions:

    1. What operating system are you running?
    2. Do you have IIS installed, do you know?

    Ray at home

    <> wrote in message
    news:...


    > I am not trying to get this to run on a webserver at this point. I am
    > just trying to get it run in a regular folder on my computer. I
    > thought that might be the reason why I wasn't receiving any email but
    > then the Response.Write doesn't work either. When I don't add the html
    > tags I get a message that asks if I want to save or open the
    > process.asp page instead of just running it.
    >
    > A little help? I'm obviously missing something . . . any advice would
    > be greatly appreciated!
     
    Ray Costanzo [MVP], Jan 3, 2006
    #2
    1. Advertising

  3. Guest

    Thanks Ray,

    I do have IIS installed and I am running Windows XP. However, the
    webpage will not reside on my computer however. What do I need to do?

    Joy
     
    , Jan 3, 2006
    #3
  4. The web page ~will~ not but currently does? That's fine. That's normal.
    In a default IIS setup, your "home page" for your site should reside in
    C:\Inetpub\wwwroot. Put your ASP files there and test them by going to
    http://localhost/yourpagename.asp

    NOW, other things:

    CDONTS = CDO for NT Server. You're running Windows XP. It does not have
    CDONTS. If you installed the SMTP service when you installed IIS, you'll
    have CDOSYS. Read this: http://www.aspfaq.com/show.asp?id=2026 Depending
    on your setup where you're working, the e-mails may not actually be sent.
    Like, if you're a bank teller playing with ASP files in between customers
    and you start trying to relay e-mail from your site, it probably won't go.
    Instead, you may wind up getting a call from a network admin asking why your
    machine is trying to relay mail. I suggest that you just stop the SMTP
    service and test the success of your ASP code by verifying that the mail was
    placed in C:\Inetpub\mailroot\pickup, if it turns out that you cannot relay
    mail from your machine.

    Ray at home

    <> wrote in message
    news:...
    > Thanks Ray,
    >
    > I do have IIS installed and I am running Windows XP. However, the
    > webpage will not reside on my computer however. What do I need to do?
    >
    > Joy
    >
     
    Ray Costanzo [MVP], Jan 4, 2006
    #4
  5. Guest

    Thank you so much Ray, I have done as you instructed and I placed the
    folder containing all my html and asp files in C:\Inetpub\wwwroot and
    then I created a virtual directory in IIS that points to that folder (I
    was supposed to do that right?) but when I say
    http://localhost/yourpagename.asp - it says the page cannot be
    displayed - do you have any idea what is wrong?

    Thanks!

    Joy
     
    , Jan 4, 2006
    #5
  6. Guest

    Ok, silly me, I just needed to add the folder name to the path -
    another question - I understand why the CDONTS doesn't work but
    Response.Write doesn't work at all either. Can you tell from my code
    if I am doing anything wrong?

    Thanks!

    Joy
     
    , Jan 4, 2006
    #6
  7. Larry Bud Guest

    wrote:
    > Thank you so much Ray, I have done as you instructed and I placed the
    > folder containing all my html and asp files in C:\Inetpub\wwwroot and
    > then I created a virtual directory in IIS that points to that folder (I
    > was supposed to do that right?) but when I say
    > http://localhost/yourpagename.asp - it says the page cannot be
    > displayed - do you have any idea what is wrong?


    If you're using IE, make sure in Internet Options that "Show Friendly
    HTTP error messages" is turned OFF.

    This way the browser will tell you exactly where the error is occurring
    in the ASP. There could be a syntax error on line 1, and you'd never
    know it.
     
    Larry Bud, Jan 4, 2006
    #7
  8. Show us your current code that you have now, and what does "doesn't work"
    mean? Do you get an error? What does it say? Do you get a blank page?

    Also, did you read what I wrote about how CDONTS hasn't really been in vogue
    since 1999?

    Ray at home

    <> wrote in message
    news:...
    > Ok, silly me, I just needed to add the folder name to the path -
    > another question - I understand why the CDONTS doesn't work but
    > Response.Write doesn't work at all either. Can you tell from my code
    > if I am doing anything wrong?
    >
    > Thanks!
    >
    > Joy
    >
     
    Ray Costanzo [MVP], Jan 4, 2006
    #8
  9. Guest

    Hello ,
    About the CDOSYS as Ray Costanzo [MVP] said, he is correct, but in
    addition when you declare and set the variable, i noticed that you
    wrote Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    Its better to write Set MyCDONTSMail =
    Server.CreateObject("CDONTS.NewMail")
    I know that you might say that "what did u add the server, i doesn't
    make any difference" but trust me, when u program using Microsoft
    programs, everything is possible. For example once i was using
    MapPath("Location.mdb") and always getting an error, but couldn't find
    it, then i had an idea, which was to add server to the command, so it
    looked like this Server.MapPath("Locatuo.mdb"), after that the page
    worked propoply with no extra problem, and by the way when u click
    Ctrl+Space in Microsoft Visual InterDev you will find that MapPath
    works without the Server as well as the CreateObject.


    Hope this helps


    Best Regards
    Firas S Assaad
     
    , Jan 5, 2006
    #9
  10. wrote:
    > Hello ,
    > About the CDOSYS as Ray Costanzo [MVP] said, he is correct, but in
    > addition when you declare and set the variable, i noticed that you
    > wrote Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    > Its better to write Set MyCDONTSMail =
    > Server.CreateObject("CDONTS.NewMail")



    In older versions of IIS, this did make a difference. In newer versions, the
    recommendation is to use the vbscript version of CreateObject, rather than
    the version provided by the Server object. For more information, see:

    http://blogs.msdn.com/ericlippert/archive/2004/06/01/145686.aspx


    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Jan 5, 2006
    #10
  11. Paxton Guest

    wrote:
    > Thank you so much Ray, I have done as you instructed and I placed the
    > folder containing all my html and asp files in C:\Inetpub\wwwroot and
    > then I created a virtual directory in IIS that points to that folder (I
    > was supposed to do that right?) but when I say
    > http://localhost/yourpagename.asp - it says the page cannot be
    > displayed - do you have any idea what is wrong?
    >
    > Thanks!
    >
    > Joy


    Just a thought.... but are you actually typing
    "http://localhost/yourpagename.asp" into the address bar of the
    browser?

    If so, you should replace "yourpagename.asp" with the name of the
    directory you created, then "/" then the name of the html file you
    created (with ".html" on the end).

    /P.
     
    Paxton, Jan 5, 2006
    #11
  12. Bob Barrows [MVP] wrote:
    > In older versions of IIS, this did make a difference. In newer
    > versions, the recommendation is to use the vbscript version of
    > CreateObject, rather than the version provided by the Server object.
    > For more information, see:
    > http://blogs.msdn.com/ericlippert/archive/2004/06/01/145686.aspx


    How on Earth do you get any recommendation out of Lippert's article?

    On the contrary, one of the comments suggests that this approach voids
    connection pooling, and that would certainly give me pause.



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
     
    Dave Anderson, Jan 5, 2006
    #12
  13. Dave Anderson wrote:
    > Bob Barrows [MVP] wrote:
    >> In older versions of IIS, this did make a difference. In newer
    >> versions, the recommendation is to use the vbscript version of
    >> CreateObject, rather than the version provided by the Server object.
    >> For more information, see:
    >> http://blogs.msdn.com/ericlippert/archive/2004/06/01/145686.aspx

    >
    > How on Earth do you get any recommendation out of Lippert's article?


    Yes, you're right. My bad. Eric made no recommendations. I had a
    recommendation made in a post by Egbert Nierop
    (http://groups.google.com/group/microsoft.public.inetserver.asp.general/msg/
    409380a9492fb9c8?hl=en&) in the back of my mind when I wrote the above. He
    had done some testing and come to the conclusion that using the Server
    version was not only unnecessary in IIS5+, but that it also impaired
    performance.

    Here's a another quote:

    WEll, quite simple. IIS 3/4 supported transaction management COM integration
    using Server.Createobject. This statement, passes the COM context from ASP
    to the inner component.
    As of Windows 2000, this is no longer needed because of native COM support
    for transactions and context passing, and it even slows down execution. On
    windows 2000, it will process exception on components, that have no thread
    affinity (C++).

    >
    > On the contrary, one of the comments suggests that this approach voids
    > connection pooling, and that would certainly give me pause.
    >

    Yes, me too. But this was not stated by Eric, and was not substantiated by
    the person who brought it up.

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Jan 5, 2006
    #13
  14. Bob Barrows [MVP] wrote:
    > I had a recommendation made in a post by Egbert Nierop (
    > http://groups.google.com/group/microsoft.public.inetserver.asp.general/msg/409380a9492fb9c8?hl=en
    > &) in the back of my mind when I wrote the above.


    Fair enough.



    > He had done some testing and come to the conclusion that
    > using the Server version was not only unnecessary in IIS5+,
    > but that it also impaired performance.


    When I read his post, I had a reaction similar to yours below.



    >> On the contrary, one of the comments suggests that this
    >> approach voids connection pooling, and that would certainly
    >> give me pause.

    >
    > Yes, me too. But this was not stated by Eric, and was not
    > substantiated by the person who brought it up.


    Like you, I would have liked something concrete. And that is why I merely
    said it would give me pause. In truth, I do not feel that EITHER assertion
    was backed up with substance, so neither would be likely to change my
    practices.

    If I thought I had a limitless number of ASP-coding days ahead of me, I
    might spend some time exploring the issues in order to convince myself one
    way or the other. But let's face it -- most of us will be doing less and
    less with ASP in the future, so why waste the time looking for a cycle here
    and there? It's not as if anyone suggested that either approach would cause
    some type of cascading performance issue...



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
     
    Dave Anderson, Jan 5, 2006
    #14
  15. Dave Anderson wrote:
    > Bob Barrows [MVP] wrote:
    >> I had a recommendation made in a post by Egbert Nierop (
    >> http://groups.google.com/group/microsoft.public.inetserver.asp.general/msg/409380a9492fb9c8?hl=en
    >> &) in the back of my mind when I wrote the above.

    >
    > Fair enough.
    >
    >
    >
    >> He had done some testing and come to the conclusion that
    >> using the Server version was not only unnecessary in IIS5+,
    >> but that it also impaired performance.

    >
    > When I read his post, I had a reaction similar to yours below.
    >

    I suspected that would be your response, and after posting the above, tried
    to find the post that really convinced me, but could not find it, so as you
    say later on in your reply, it's time to move on.


    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Jan 6, 2006
    #15
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=

    No Class at ALL!!! beginner/beginner question

    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=, Feb 2, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    659
    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=
    Feb 3, 2005
  2. Rensjuh
    Replies:
    7
    Views:
    1,053
    Mabden
    Sep 2, 2004
  3. JohnS
    Replies:
    6
    Views:
    319
    Marcus Kwok
    Jun 9, 2006
  4. Michael Judge

    Design problems (beginner)

    Michael Judge, Jan 26, 2006, in forum: Ruby
    Replies:
    2
    Views:
    88
    Gregory Brown
    Jan 26, 2006
  5. william nelson

    Beginner's Beginner

    william nelson, Apr 11, 2011, in forum: Ruby
    Replies:
    7
    Views:
    264
    7stud --
    Apr 12, 2011
Loading...

Share This Page