Announcement

Collapse
No announcement yet.

Convert ASPX to ASP

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

  • Convert ASPX to ASP



    -Rick

    some examples - full text in attachment

    <META name=viewport content="width = 320">
    <META name=viewport content="initial-scale=1, user-scalable=no">
    <META name=apple-mobile-web-app-capable content=yes>
    <SNIP>
    </FORM>
    Code:
     
    <script runat="server"> 
        dim hs as object 
        Sub Page_Load(Sender As Object, E As EventArgs) 
            hs = Context.Items("Content") 
        end sub 
    </script> 
    
     
     If Request.Form("sVal29") = "On" Then 
            hs.transmit("q22", "On", 0, 0) 
     ElseIf Request.Form("sVal30") = "Off" Then 
            hs.transmit("q22", "Off", 0, 0) 
     End If 
     
     If Request.Form("sVal32") = "Arm" Then 
      Dim VA 
      VA = hs.Plugin("Vista Alarm") 
      VA.ArmStay() 
     End If
    <%
    If Request.Form("sVal11") = "On" Then
    hs.transmit("Q1", "On", 0, 0)
    ElseIf Request.Form("sVal12") = "Off" Then
    hs.transmit("Q1", "Off", 0, 0)
    End If

    If Request.Form("sVal13") = "On" Then
    hs.execX10("q24", "On", 0, 0)
    ElseIf Request.Form("sVal14") = "Off" Then
    hs.execX10("q24", "Off", 0, 0)
    End If

    If Request.Form("sVal31") = "Disarm" Then
    Dim VA
    VA = hs.Plugin("Vista Alarm")
    VA.Disarm()
    End If
    %>
    Attached Files
    -Rick

  • #2
    I'll bow to someone elses knowledge but I looked at some ASPx (before giving up) and it had a load of

    < asp:Button id=Button1 runat="server" Text="Button" >< /asp:Button >

    commands for buttons...are you running this as an .aspx page currently?

    Either way does not look that difficult to change into a regular ASP page from where i'm standing...the only thing that springs out at the minute is there are quite a few if then else commands that perhaps it is going through causing a delay?
    My Plugins:

    Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
    Yeelight 3P | Nanoleaf 3P

    Comment


    • #3
      I am running the aspx page successfully as aspx its just the intial load of the aspx code that takes forever something like 5 or 6 seconds... subsquent button presses process just fine. I think I know this is a junk/garbage collector issue fairly well known that doesn't seem to have a fix so thats why I would like to convert to asp. I AM WELL OVER my head in this swimming pool!

      I have tried with no success to move it to just asp and your comment about elseif's I took to mean maybe that statement is not supported so I removed them. But here is my next problem - the test page now produces this error:

      Script error: Exception from HRESULT: 0x800A0414
      If Request.Form.Item("sVal1") = "On" Then hs.execX10("A3", "On", 0, 0)

      anyway I feel really dumb...

      thanks for your interest though!

      -rick

      HTML Code:
      <%@ Language=VBScript %>
      
      <HTML> 
      <HEAD> 
      
      <meta name="viewport" content="width = 320" />  
      <meta name="viewport" content="initial-scale=1, user-scalable=no" /> 
      <meta name="apple-mobile-web-app-capable" content="yes"> 
      <title>Device Control</title>
      
      <style type="text/css">
      }
      .auto-style1 {
      	border: 1px solid #000000;
      }
      .auto-style4 {
      	text-align: center;
      	font-family: Arial, Helvetica, sans-serif;
      	font-size: large;
      }
      </style>
      
      </HEAD> 
      
      <BODY> 
      
      <form name=first action=tcontrol.asp method=post> 
      
      <div align="center">
      <center> 
      
      <table cellpadding='0' cellspacing='0' class="auto-style1" style="width: 300" align="center">
      
      <tr>
        <td width='000' class="auto-style4" style="width: 75" ><p align='center'><input type=submit value="On" name="sVal1" class="auto-style4" ></td>
        <td width='000' style="width: 150" ><p align='center' class="auto-style4">Ceiling</td>
        <td width='000' style="width: 75" ><p align='center'><input type=submit value="Off" name="sVal2" class="auto-style4" ></td>
      </tr>
      
      <tr>
        <td width='000' class="auto-style4" style="width: 75"><p align='center'><input type=submit value="On" name="sVal34" class="auto-style4"></td>
        <td width='000' style="width: 150"><p align='center' class="auto-style4" >Outlets (NL)</td>
        <td width='000' style="width: 75"><p align='center'><input type=submit value="Off" name="sVal35" class="auto-style4"/></td>
      </tr>
      
      <tr>
        <td width='000' class="auto-style4" style="width: 75"><p align='center'></td>
        <td width='000' style="width: 150"><p align='center' ><input type=submit value="Chime" name="sVal33" class="auto-style4" style=" width: 100px;height:38px"></td>
        <td width='000' style="width: 75"><p align='center'></td>
      </tr>
      
      </table>
      </center>
      </div>
      </form> 
      
      <% 
          If Request.Form("sVal1") = "On"  Then hs.execX10("A3", "On", 0, 0)
          
          If Request.Form("sVal2") = "Off" Then hs.execX10("A3", "Off", 0, 0) 
        
          If Request.Form("sVal34") = "On" Then 
              hs.transmit("q3", "On", 0, 0) 
              hs.transmit("q9", "On", 0, 0) 
              hs.transmit("q14", "On", 0, 0) 
              hs.transmit("q15", "On", 0, 0) 
              hs.transmit("q16", "On", 0, 0) 
      	End if
      	
      	If Request.Form("sVal35") = "Off" Then 
              hs.transmit("q3", "Off", 0, 0) 
              hs.transmit("q9", "Off", 0, 0) 
              hs.transmit("q14", "Off", 0, 0) 
              hs.transmit("q15", "Off", 0, 0) 
              hs.transmit("q16", "Off", 0, 0) 
      	End If 
      
      	If Request.Form("sVal33") = "Chime" Then 
      		Dim VA 
      		VA = hs.Plugin("Vista Alarm") 
      		VA.ChimeMode() 
      	End If 
      %> 
      
      </BODY> 
      </HTML>
      -Rick

      Comment


      • #4
        Of course I forgot, I don't think you need the brackets with ASP (as it is akin to vbscript) but you might need to in ASPx (as it is more like vb.net). That might be somewhere to start at least taking some of those out...
        My Plugins:

        Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
        Yeelight 3P | Nanoleaf 3P

        Comment


        • #5
          making progress after removing the parens...

          -rick
          -Rick

          Comment

          Working...
          X