Click here to Skip to main content
16,012,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello , i have use javascript timer function for my online exam,
actually i store the result in one label clalled Label1.
and i want to use the text of this label i.e as to add the path of my huperlink below..
XML
else {
              alert("Time Out!");
          

              window.location ="result.aspx?score=" + eval(Label1.Text);

          }



but i getting problm ..can you correct the above link so that i able to send the label text(result) to my result webapge where i want to show my result.....
Posted

1 solution

Whay not to use
JavaScript
document.GetElementById("Label1").value;

instead of
JavaScript
eval(Label1.Text);

?

In your way:
JavaScript
window.location ="result.aspx?score=" +'<%# Eval(Label1.Text)%>';
 
Share this answer
 
v2
Comments
Cto Manav Parasrampuria 4-Jan-13 8:03am    
i use this one ...but i was unable to redirect to my result webpage after time out....
Cto Manav Parasrampuria 4-Jan-13 8:09am    
helo i used above suggestion..it is able to redirect as.
http://localhost:1119/website1/result.aspx?score=
but after that score label1 is unable to return the value...so kindly pls help me..
Cto Manav Parasrampuria 4-Jan-13 8:53am    
any one can help....i need solution immediately..
Zafar Sultan 4-Jan-13 9:00am    
Remove: window.location ="result.aspx?score=" +'<%# Eval(Label1.Text)%>'; and add: var score = document.GetElementById("Label1").value; alert(score); See if you are able to get the label's text before redirecting. Also, are you displaying the score on page or the label is hidden?
Cto Manav Parasrampuria 4-Jan-13 9:06am    
not working....!!wait i'm sending my code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900