Home All Groups Group Topic Archive Search About

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



Author
18 Mar 2005 6:30 PM
Tom Petersen
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!!!

AddThis Social Bookmark Button