Hello all,
I have a problem that I have never seen before and I am not sure if it's settings or my code (what there is of it!).
I use XML/XSL to create a quiz page then when the user has answered all the questions and they click the next link, a javascript function is called and the score is added up. If the score = 3 the browser should redirect to another page. This is not happening!!
I have tried with javascript and C# and nothing works. The code is executing but the page remains there
Like it's been stuck there!
Code:
C#: in Page_Load
int iScore = Convert.ToInt32(Request["hidScore"]);
if(IsPostBack)
{
if(iScore==3)
Response.Redirect("quiz-formular.aspx");
}
Javascript:
function validate() { //stop
score = score1 + score2 + score3;
if(score==3) { document.getElementById('hidScore').value = score; Form1.submit(); } }
I have tried with window.location.href = <full http path to the page> but nothing seems to work.
Can you please help me?
Thanks
Lee