Announcement

Collapse
No announcement yet.

Begging for a simple example of a aspx page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Begging for a simple example of a aspx page

    Giving up on IIS for now.

    I'm looking for a really simple example of an aspx page. Also what are people using for a web config file?

    Thanks
    Don

  • #2
    For HS3?

    There is test.aspx in the html folder.
    Jon

    Comment


    • #3
      In my frustration, I had overwritten the origional code. Running something that I cobbled up as a basic page produces the following error message.
      PHP Code:
      Could not determine which version of ASP.NET Web Pages to use.

      In order to use this sitespecify a version in the site’s web.config file. For more information, see the following article on the Microsoft support site: http://go.microsoft.com/fwlink/?LinkId=254126 
      I'm assuming that I need to tweak web.config with the proper version number, but am clueless how to do that.

      Thanks for the reply.
      Don

      Comment


      • #4
        Here's the contents of the original file:
        PHP Code:
        <%@ Page Language="VB" %>
        <
        script runat="server">

            
        ' Insert page code here
            '
            
        Dim hs As Scheduler.hsapplication
            Dim plugin 
        As HomeSeerAPI.PluginAccess
            
            Sub Page_Load
        (Sender As ObjectAs EventArgs)
                
        ' for use with the HS web server
                hs = Context.Items("Content")
                
                ' 
        get a reference to the Z-Wave plugin
                plugin 
        = New HomeSeerAPI.PluginAccess(hs"Z-Wave""")
                If 
        plugin.Connected Then
                    Label2
        .Text "Connected to Z-Wave plugin, name=" plugin.Name
                End 
        If
                
        label1.text "HomeSeer Ver: " hs.version
                
                Dim EN 
        As Scheduler.Classes.clsDeviceEnumeration
                Dim dv 
        As Scheduler.Classes.DeviceClass
                EN 
        hs.GetDeviceEnumerator
                
        Do
                    
        dv EN.GetNext
                    
        If dv Is Nothing Then Continue Do
                
        Loop Until EN.Finished
            end sub
            
            Sub ButSpeak_Click
        (sender As ObjectAs EventArgs)
                
        hs.speak(txtspeak.text,false,"")
                
        Dim EN As Scheduler.Classes.clsDeviceEnumeration
                Dim dv 
        As Scheduler.Classes.DeviceClass
                EN 
        hs.GetDeviceEnumerator
                
        Do
                    
        dv EN.GetNext
                    
        If dv Is Nothing Then Continue Do
                
        '    hs.WriteLog("SAMPLE", "Found device from aspx: " & dv.Name(Nothing))
                '    
        If dv.Interface(NothingIsNot Nothing Then
                 
        '       If dv.Interface(Nothing).Trim = "Sample Plugin" Then
                 '           
        hs.WriteLog("SAMPLE""Found device from aspx: " dv.Name(Nothing))
                
        '        End If
                '    
        End If
                
        Loop Until EN.Finished
            End Sub

            
        Protected Sub Button1_Click(ByVal sender As ObjectByVal e As System.EventArgs)
                
        'hs.ExecX10("q7", "on")
            End Sub

            Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
                '
        hs.ExecX10("q7""off")
            
        End Sub
            
            
        Private Function GetHeadContent() As String
                
        Try
                    Return 
        hs.GetPageHeader("""Test Page"""""FalseFalseTrueFalseFalse)
                Catch 
        ex As Exception
                End 
        Try
                Return 
        ""
            
        End Function
            
            Private Function 
        GetBodyContent() As String
                
        Try
                    Return 
        hs.GetPageHeader("""Test Page"""""FalseTrueFalseTrueFalse)
                Catch 
        ex As Exception
                End 
        Try
                Return 
        ""
            
        End Function
            
        </
        script>
        <
        html>
        <
        head runat="server">
        <%
        response.write(GetHeadContent())%>
        </
        head>
        <
        body>
        <% 
        response.write(GetBodyContent()) %>
            <
        form runat="server">
                <
        p>
                    <
        asp:Label id="Label1" runat="server" width="210px">Label</asp:Label>
                </
        p>
                <
        p>
                    <
        asp:Label id="Label2" runat="server" width="400px">Label</asp:Label>
                </
        p>
                <
        p>
                </
        p>
                <
        p>
                    <
        asp:Button id="ButSpeak" onclick="ButSpeak_Click" runat="server" Text="Speak"></asp:Button>
                    <
        asp:TextBox id="TxtSpeak" runat="server"></asp:TextBox>
                </
        p>
                <
        p>
                    <
        asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Light On" />
                </
        p>
                <
        p>
                    <
        asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Light Off" />&nbsp;</p>
                
                <!-- 
        Insert content here -->
            </
        form>
        </
        body>
        </
        html
        -Rupp
        sigpic

        Comment


        • #5
          Thank you both. I had somehow gummed up the hs web server. I dumped a bunch of stuff restarted my machine, and it now works.

          The zero and one gods like me again, I guess. :-)
          Don

          Comment

          Working...
          X