DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Error with QueryString. Help please!

  1. #1
    Join Date
    May 2007
    Posts
    44

    Error with QueryString. Help please!

    I have a form that has 3 submit buttons. They all call the same .asp file, but different information is processed depending on which button is pressed. Is there a way for me to check which button was pressed using the QueryString?
    Here's the code I'm currently trying, but I am getting an error on the server:

    Code:
     
        On Error Resume Next
        
        For each item in Request.QueryString()
            
            If item = "submitIt" Then
                ObjSendMail.To = Request.QueryString("SupEmail")
                ObjSendMail.Subject = "foobar"
                ObjSendMail.From = Request.QueryString("ReqEmail")
                body = "blah"
            ElseIf item = "approveIt" Then
                ObjSendMail.To = "Christian.Grise@usa.dupont.com
                ObjSendMail.Subject = "bar"
                ObjSendMail.Cc = Request.QueryString("ReqEmail")
                ObjSendMail.From = Request.QueryString("SupEmail")
                body = "blahdy"
            ElseIf item = "denyIt" Then
                ObjSendMail.To = Request.QueryString("ReqEmail")
                ObjSendMail.Subject = "foo"
                ObjSendMail.From = Request.QueryString("SupEmail")
                body = "blah blah"    
            End If
        Next
    Any help will be greatly appreciated. Thank you in advance.

    Christian

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    What is the server side error that you are getting?

  3. #3
    Join Date
    Jul 2007
    Location
    Minnesota
    Posts
    155
    Just by looking at the code, it looks pretty wrong to me.

    We use for each item in Request.querystring("yourItemDefinition"), in your case, you would have
    Code:
    For each item in Request.QueryString("Item")

Similar Threads

  1. querystring adding comma and space
    By rdwagco2 in forum ASP.NET
    Replies: 1
    Last Post: 08-23-2005, 03:45 PM
  2. Replies: 1
    Last Post: 10-30-2001, 01:05 PM
  3. Anchor and Querystring Parameters in IE
    By Dan Zettle in forum ASP.NET
    Replies: 1
    Last Post: 04-07-2000, 05:17 AM
  4. Anchor and Querystring Parameters in IE
    By Dan Zettle in forum Web
    Replies: 0
    Last Post: 04-06-2000, 09:13 PM
  5. QueryString
    By pt3 in forum ASP.NET
    Replies: 1
    Last Post: 03-13-2000, 11:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center