Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Redirection
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Redirection

 Post Reply Post Reply
Author
Leeb65 View Drop Down
Groupie
Groupie


Joined: 05 December 2003
Location: Germany
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote Leeb65 Quote  Post ReplyReply Direct Link To This Post Topic: Redirection
    Posted: 05 December 2003 at 2:50am

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 

Back to Top
Leeb65 View Drop Down
Groupie
Groupie


Joined: 05 December 2003
Location: Germany
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote Leeb65 Quote  Post ReplyReply Direct Link To This Post Posted: 10 December 2003 at 1:05am

Okay, I found the answer to that problem and it appears that I cannot submit the form properly from an <A> tag.

Has anyone any idea why this is?

Thanks

Lee

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 11 December 2003 at 12:41am
Where's your code to submit the form?

something like:

<a href="javascript:document.frm.submit();">Submit</a>

should work. It doesn't work when there's a submit button on the form so if you got a submit button make it a regular button and add the submit on the onClick event. If you got any <button></button> tags their type is submit by default so you need to add the type="button" property.

I'm not sure that's what you mean though...
FeRnAN
Back to Top
Leeb65 View Drop Down
Groupie
Groupie


Joined: 05 December 2003
Location: Germany
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote Leeb65 Quote  Post ReplyReply Direct Link To This Post Posted: 11 December 2003 at 1:25am

Hi Fernan, Thanks for your input.

I had already tried your method, but it didn't work. The site is in a frameset (bad practice I know, but it was already designed as far as the HTLM goes.)

So I sent the information to another document in another frame and that told the correct document to load in the correct frame.

F.Y.I. There are 3 button types in VS.NET (button, submit & reset)

Lee

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 11 December 2003 at 5:24am
Originally posted by Leeb65 Leeb65 wrote:

Okay, I found the answer to that problem and it appears that I cannot submit the form properly from an <A> tag.

Has anyone any idea why this is?

Thanks

Lee

it's called the "LinkButton" control

Contribute to the working anarchy we fondly call the Internet
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.