
October 16th, 2000, 11:34 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,578
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
Session Variable losses value when calling a URL from JS Function
<i><b>Originally posted by : Chris.g (Chrisg@apdomail.sgp.hp.com)</b></i><br />Session Variable losses value when calling a URL from JS Function<br /><br />This happens only in Netscape Communicator 6.1, in IE it works fine.<br /><br />Have a combo Box populated with Customer_ No in ASP Page1, when a value in the combo box is selected the SubmitEvent<br />his fired and it redirect to a nother ASP page(Page2), Customer-No and other params are passed along with the URL to PAGE2.<br /><br />Everything is fine, except when trying to access the values of session variable in called ASP page(Page2) , all the<br />values of the session variable assigned in ASP Page(Page1) is lost. Why this happen so?. Even I tried to redirect to<br />ASP page using document.Location, this also works, but still the value in the session variables are lost.<br /><br /><br />This is the combo box in ASP Page 1, populated with Customer_No along with the event<br />================================================== ============<br /><FORM><br /> <SELECT language=javascript name="lstCustCode" onChange="SubmitEvent(document.SelectCustomer)"> <br /> <OPTION selected>Select CRI Customer Code</OPTION> <br /> <% For row = 0 to UBound(CustCodeArray,2)%><br /> <OPTION value="<%= CustCodeArray(0,row)%>"><%=CustCodeArray(0,row) & "-" & CustCodeArray(1,row)%></OPTION><br /> <% Next%><br /> </SELECT> <br /></FORM> <br /><br /><br />This is the JavaScript Function in ASP Page 1, which is being called by the event "SubmitEvent"<br />================================================== ============<br /><script language="JavaScript"><br /> function SubmitEvent(myForm) {<br /> var nGetIndex;<br /> var sValue;<br /> <br /> nGetIndex=document.SelectCustomer["lstCustCode"].selectedIndex -1;<br /> sValue=document.SelectCustomer["lstCustCode"].options[document.SelectCustomer["lstCustCode"].selectedIndex].value<br /> alert('http://atp3975/CRiRevamp/cri0000/cri0003.asp?ARRVAL=T'+'&CustNo='+sValue+'&apcic_flag=1');<br /> <br /> myForm.action="http://atp3975/CRiRevamp/cri0000/cri0003.asp?ARRVAL=T"+"&CustomNo="+sValue+ ""<br /> myForm.submit()<br /> <br />} <br /> </script> <br /><br />Is it so that the values in session variable are lost when being redirected within Java function?.<br /><br /><br /><br />Kindest regards,<br />Chris.G<br /><br />
|