Announcement

Collapse
No announcement yet.

ASP reload hanging

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

    ASP reload hanging

    Hi,

    HS3 has caused me to question my abilities yet again...

    I have been using <form name=first action=bedroom.asp method=post> for a long while for building my interface to HS2 and now HS3. The code looks like this this is and this example just toggles device value and string between 0 and a 100.

    Code:
    If Request.Form("sValM34") = "Fade" Then
    		theDevice = 545
    		devValue = hs.DeviceValue(theDevice)
    		If devValue > 0 Then																		' Device ON or DIM, turn it OFF
    			hs.CAPIControlHandler(hs.CAPIGetSingleControl(theDevice,true ,"off",false,true))
    		    hs.SetDeviceValueByRef theDevice,0,true
    	    	hs.SetDeviceString theDevice,Cstr(0),true
    			Else
    			hs.CAPIControlHandler(hs.CAPIGetSingleControl(theDevice,true ,"on",false,true))
    		    hs.SetDeviceValueByRef theDevice,100,true
    	    	hs.SetDeviceString theDevice,Cstr(100),true
    		End If
    		hs.waitsecs (.3)
        end if
    And this is the code that sets it in motion.

    Code:
    	<tr>	
    		<td style="height: 40px" ><p align='center'><input type=submit value="Open"				name="sValM31" 	style="width: 85px;height:35px;;			"class="Button-1" ></td>
    		<td style="height: 40px" ><p align='center'><input type=submit value=""					name="sValM32" 	style="width: 35px;height:35px;;			"class="Button-2" ></td>
    		<td style="height: 40px" ><p align='center'><input type=submit value=""					name="sValM33" 	style="width: 35px;height:35px;;			"class="Button-2" ></td>
    		<td style="height: 40px" ><p align='center'><input type=submit value="Fade"				name="sValM34" 	style="width: 85px;height:35px;<%=bcolor(545)%>;	"class="Button-1" ></td>
    		<td style="height: 40px" ><p align='center'><input type=submit value=""					name="sValM35" 	style="width: 35px;height:35px;;			"class="Button-2" ></td>
    		<td style="height: 40px" ><p align='center'><input type=submit value=""					name="sValM36" 	style="width: 35px;height:35px;;			"class="Button-2" ></td>
    	</tr>
    And it all works just fine; the device goes on and off and the button color follows the device value. But when I link the virtual device being controlled by the button to an event looking for device value change that runs a script that I use to fade the master bedroom lights, the form post reload of the APS never completes. I can exit, reload bedroom.asp and all the expected results are seen, the script is running and I can disable it by clicking the button fade and it turns off fine and the reload of the form works as it should. The script is looking for the virtual device and if it goes to 0 it then exits gracefully. It makes no difference if I have the wait for script checked or not in the event.

    Ps. This is try number 2, initially the bedroom.asp just activated the script on a button press but the ASP had the same behavior now seen in the virtual device associated with the script.

    Anybody have any suggestions?
    Attached Files
    -Rick
Working...
X