none
70-515 exam sample tests - Login Server.Transfer or Server.Execute? RRS feed

  • Question

  • I have been doing lots of practice tests on the internet and one question keeps coming up and I disagree with the answer, so I wanted to ask you guys who is right?

    The question says that Server.Execute should be used, but I think it should be Server.Transfer because if the user does not successfully login, using Server.Execute, control will pass back to the original page and the user WILL see the content of the rest of the page, wont it?  With Server.Transfer, you can put a redirecturl as a param to the login form, so that if login is successful, the original page will be reloaded, this time authenticated???????

    Thursday, March 28, 2013 3:06 PM

Answers

  • You can't trust the practice tests that you find on the internet to always provide the correct answers. There are plenty of mistakes in those tests. The important thing is that you know the subject matter and you understand what each option does and how it works.

    In the specific case of the question that you quoted, my own reply would be "none of the above". Or, in other words, none of the provided answers would solve the problem all by itself, and some additional coding and configuration would be needed. Depending on how you did that additional coding and configuration (which are not mentioned in the question or the answers), the answer could vary. This makes the question a "bad" one, since a requirement for an exam question is that the right answer must be 100% right, and the wrong answers must be 100% wrong. This is not satisfied by this question. The real questions in the actual certification exam tend to be "good" ones and satisfy the previous requirements. Unfortunately, this is often not true for the practice questions that you find on the 'net.

    So, how would I code an ASP.NET application to satisfy the requirements of this question? I would just enable ASP.NET authentication and authorization in web.config. In the authorization section, deny anonymous access to all the pages that need to be protected. Enable Forms authentication and point the loginUrl to our login page. That's it; no coding required, just some changes in web.config. When a user tries to access any page, he or she will be redirected to the login page and, only after a successful login, the page that was initially requested would be shown. This satisfies the requirements of the question, but was not any of the available answers.

    Friday, March 29, 2013 9:00 AM