Outlook Calendar - passing values from an .asp to .aspx file?

Discussion in 'ASP General' started by Tom Petersen, Mar 18, 2005.

  1. Tom Petersen

    Tom Petersen Guest

    I have this code taken from a website that works fine:

    <%@ Page Language="vb" ContentType="text/html" ResponseEncoding="iso-8859-1"
    Debug="False" trace="False"%>
    <%@ import Namespace="System.IO" %>


    <script runat="server">
    Sub Page_Load(Sender As Object, E As EventArgs)

    'PARAMETERS
    Dim beginDate as Date = #01/07/2005 4:00 PM#

    Dim endDate as Date = #01/07/2005 6:00 PM#
    Dim myLocation as String = "Computer Room"
    Dim mySubject as String = "test"
    Dim myDescription as String = "Event details"
    'INITIALIZATION
    Dim mStream As new MemoryStream()
    Dim writer As new StreamWriter(mStream)
    writer.AutoFlush = true
    'HEADER
    writer.WriteLine("BEGIN:VCALENDAR")
    writer.WriteLine("PRODID:-//Flo Inc.//FloSoft//EN")
    writer.WriteLine("BEGIN:VEVENT")
    'BODY
    writer.WriteLine("DTSTART:" &
    beginDate.ToUniversalTime.ToString("yyyyMMdd\THHmmss\Z") )
    writer.WriteLine("DTEND:" &
    endDate.ToUniversalTime.ToString("yyyyMMdd\THHmmss\Z") )
    writer.WriteLine("LOCATION:" & myLocation)
    writer.WriteLine("DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" &
    myDescription)
    writer.WriteLine("SUMMARY:" & mySubject)
    'FOOTER
    writer.WriteLine("PRIORITY:3")
    writer.WriteLine("END:VEVENT")
    writer.WriteLine("END:VCALENDAR")
    'MAKE IT DOWNLOADABLE
    Response.Clear() 'clears the current output content from the buffer
    Response.AppendHeader("Content-Disposition", "attachment;
    filename=Add2Calendar.vcs")
    Response.AppendHeader("Content-Length", mStream.Length.ToString())
    Response.ContentType = "application/download"
    Response.BinaryWrite(mStream.ToArray())
    Response.End()
    End Sub

    </script>

    In this section:
    Dim beginDate as Date = #01/07/2005 4:00 PM#
    Dim endDate as Date = #01/07/2005 6:00 PM#
    Dim myLocation as String = "Computer Room"
    Dim mySubject as String = "test"
    Dim myDescription as String = "Event details"
    I want to be able to use values from an .ASP form instead of using preset
    values. In .asp on the page I am passing the valuse to, I can use this
    syntax:
    strBuilding = Request.Form("building"). This doesn't seem to work in .aspx.
    Is there an equivalent format I can use to set the variable value. I've
    never used .aspx before. And do I have to use the <% ... %> format, and
    where in this code would it go???

    Thanks!!!
     
    Tom Petersen, Mar 18, 2005
    #1
    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. Guest
    Replies:
    3
    Views:
    1,844
    Alexandre
    Dec 22, 2003
  2. =?Utf-8?B?U3Jpbml2YXM=?=

    Accessing Outlook calendar informaiton with ASP.NET

    =?Utf-8?B?U3Jpbml2YXM=?=, Mar 1, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    532
    =?Utf-8?B?U3Jpbml2YXM=?=
    Mar 1, 2004
  3. =?Utf-8?B?Sm9zZQ==?=

    Querying Outlook Calendar from Asp.Net Page

    =?Utf-8?B?Sm9zZQ==?=, Feb 14, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    477
    =?Utf-8?B?Sm9zZQ==?=
    Feb 14, 2005
  4. Replies:
    2
    Views:
    2,485
Loading...

Share This Page