Rewrite VB sample to C#

Posted on 2007-10-18
Last Modified: 2010-04-15
Please rewrite the below VB code in C#:

Throw new Exception("Response.Redirect(""Login.aspx"", true)")

The question is how to replace the double double quotes?

Question by:ksfok
    LVL 55

    Assisted Solution

    by:Jaime Olivares
    Throw new Exception("Response.Redirect(\"Login.aspx\", true)")

    LVL 55

    Assisted Solution

    by:Jaime Olivares
    Also "throw" keyword  must be lowercase
    LVL 19

    Assisted Solution

    by:Russ Suter
    and don't forget the semicolon at the end!
    LVL 26

    Accepted Solution

    this statement will work
    throw new Exception(@"Response.Redirect(""Login.aspx"", true)");

    Response.redirect expects a string so two double quotes are required

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Join & Write a Comment

    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now