response redirection not working - HELP!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ODAN

    #1

    response redirection not working - HELP!

    We are testing a ASP.NET application in Visual Studion 2003 and written in
    C#. One of the pages that register new users on this application fails to
    redirect to another page when the button is clicked. On the page there is a
    button that has been code to save to database and also redirect to the login
    page. When you fill out the form and click on this page, it saves the data
    into the database but it does nothing after that, it just sits there on the
    same page. We checked everytihng in the code and the web.config file. The
    web applicaiton is working good on the development workstation (Win XP), but
    not working on the server running Windows Server 2003 IIS6. Please help? Any
    ideas?


    try

    {

    if(Session["Registrant ID"]!=null)

    {

    divusername.Vis ible=false;

    string registrantId=Se ssion["Registrant ID"].ToString;

    string userName=Sessio n["username"].ToString();

    if(WRTSPublic.D ataAccess.DataA ccess.UpdateReg istrantDetails( registrantId,us erName,Registan tObj,dsCompenOr g,selectedCount iesArr))

    {

    Response.Redire ct(TrainingURL, false);

    }

    }

    else

    {

    if(WRTSPublic.D ataAccess.DataA ccess.InsertReg istrantDetails( RegistantObj,ds CompenOrg,selec tedCountiesArr) )

    {

    Response.Redire ct(Introduction URL,false);

    }

    }

    }

    catch(Exception ex)

    {

    ExceptionCatch. RegisterLog(ex. Message);

    }

    }


  • Sridhar

    #2
    RE: response redirection not working - HELP!

    Hi,

    Where did you declare the variables used in the Response.Redire ct()? Also
    try using Server.Transfer and see if that works.

    Thanks

    "ODAN" wrote:
    [color=blue]
    > We are testing a ASP.NET application in Visual Studion 2003 and written in
    > C#. One of the pages that register new users on this application fails to
    > redirect to another page when the button is clicked. On the page there is a
    > button that has been code to save to database and also redirect to the login
    > page. When you fill out the form and click on this page, it saves the data
    > into the database but it does nothing after that, it just sits there on the
    > same page. We checked everytihng in the code and the web.config file. The
    > web applicaiton is working good on the development workstation (Win XP), but
    > not working on the server running Windows Server 2003 IIS6. Please help? Any
    > ideas?
    >
    >
    > try
    >
    > {
    >
    > if(Session["Registrant ID"]!=null)
    >
    > {
    >
    > divusername.Vis ible=false;
    >
    > string registrantId=Se ssion["Registrant ID"].ToString;
    >
    > string userName=Sessio n["username"].ToString();
    >
    > if(WRTSPublic.D ataAccess.DataA ccess.UpdateReg istrantDetails( registrantId,us erName,Registan tObj,dsCompenOr g,selectedCount iesArr))
    >
    > {
    >
    > Response.Redire ct(TrainingURL, false);
    >
    > }
    >
    > }
    >
    > else
    >
    > {
    >
    > if(WRTSPublic.D ataAccess.DataA ccess.InsertReg istrantDetails( RegistantObj,ds CompenOrg,selec tedCountiesArr) )
    >
    > {
    >
    > Response.Redire ct(Introduction URL,false);
    >
    > }
    >
    > }
    >
    > }
    >
    > catch(Exception ex)
    >
    > {
    >
    > ExceptionCatch. RegisterLog(ex. Message);
    >
    > }
    >
    > }
    >
    >
    >[/color]

    Comment

    • ODAN

      #3
      Re: response redirection not working - HELP!

      The variables are in the web config; here is one of them:
      <add key="TrainingUR L" value="http://System/Training.aspx" />

      We have actually gone as far as had coding the reponse.redirec t
      (http://Systemfullpath/Training.aspx) in the .cs file. It works on the
      development workstation but not on the IIS6 server.



      "Sridhar" <Sridhar@discus sions.microsoft .com> wrote in message
      news:700AACCE-36D5-486C-969B-D4528CD6469C@mi crosoft.com...[color=blue]
      > Hi,
      >
      > Where did you declare the variables used in the Response.Redire ct()?
      > Also
      > try using Server.Transfer and see if that works.
      >
      > Thanks
      >
      > "ODAN" wrote:
      >[color=green]
      >> We are testing a ASP.NET application in Visual Studion 2003 and written
      >> in
      >> C#. One of the pages that register new users on this application fails
      >> to
      >> redirect to another page when the button is clicked. On the page there is
      >> a
      >> button that has been code to save to database and also redirect to the
      >> login
      >> page. When you fill out the form and click on this page, it saves the
      >> data
      >> into the database but it does nothing after that, it just sits there on
      >> the
      >> same page. We checked everytihng in the code and the web.config file. The
      >> web applicaiton is working good on the development workstation (Win XP),
      >> but
      >> not working on the server running Windows Server 2003 IIS6. Please help?
      >> Any
      >> ideas?
      >>
      >>
      >> try
      >>
      >> {
      >>
      >> if(Session["Registrant ID"]!=null)
      >>
      >> {
      >>
      >> divusername.Vis ible=false;
      >>
      >> string registrantId=Se ssion["Registrant ID"].ToString;
      >>
      >> string userName=Sessio n["username"].ToString();
      >>
      >> if(WRTSPublic.D ataAccess.DataA ccess.UpdateReg istrantDetails( registrantId,us erName,Registan tObj,dsCompenOr g,selectedCount iesArr))
      >>
      >> {
      >>
      >> Response.Redire ct(TrainingURL, false);
      >>
      >> }
      >>
      >> }
      >>
      >> else
      >>
      >> {
      >>
      >> if(WRTSPublic.D ataAccess.DataA ccess.InsertReg istrantDetails( RegistantObj,ds CompenOrg,selec tedCountiesArr) )
      >>
      >> {
      >>
      >> Response.Redire ct(Introduction URL,false);
      >>
      >> }
      >>
      >> }
      >>
      >> }
      >>
      >> catch(Exception ex)
      >>
      >> {
      >>
      >> ExceptionCatch. RegisterLog(ex. Message);
      >>
      >> }
      >>
      >> }
      >>
      >>
      >>[/color][/color]


      Comment

      • ODAN

        #4
        Re: response redirection not working - HELP!

        Hi Sridhar,

        We are having two different applications. One application is having
        Forms Authentication and another one is having Windows Authentication. We
        define the URL in web.config files of two application so that it would
        redirect to each application without chaning in the code behind file. But
        when we are giving Response.Redire ct() method it is not redirecting to the
        particular page in test server which is working in the development server.
        Can you please guide us what would be the problem?

        Regards,
        Odan

        "Sridhar" <Sridhar@discus sions.microsoft .com> wrote in message
        news:700AACCE-36D5-486C-969B-D4528CD6469C@mi crosoft.com...[color=blue]
        > Hi,
        >
        > Where did you declare the variables used in the Response.Redire ct()?
        > Also
        > try using Server.Transfer and see if that works.
        >
        > Thanks
        >
        > "ODAN" wrote:
        >[color=green]
        >> We are testing a ASP.NET application in Visual Studion 2003 and written
        >> in
        >> C#. One of the pages that register new users on this application fails
        >> to
        >> redirect to another page when the button is clicked. On the page there is
        >> a
        >> button that has been code to save to database and also redirect to the
        >> login
        >> page. When you fill out the form and click on this page, it saves the
        >> data
        >> into the database but it does nothing after that, it just sits there on
        >> the
        >> same page. We checked everytihng in the code and the web.config file. The
        >> web applicaiton is working good on the development workstation (Win XP),
        >> but
        >> not working on the server running Windows Server 2003 IIS6. Please help?
        >> Any
        >> ideas?
        >>
        >>
        >> try
        >>
        >> {
        >>
        >> if(Session["Registrant ID"]!=null)
        >>
        >> {
        >>
        >> divusername.Vis ible=false;
        >>
        >> string registrantId=Se ssion["Registrant ID"].ToString;
        >>
        >> string userName=Sessio n["username"].ToString();
        >>
        >> if(WRTSPublic.D ataAccess.DataA ccess.UpdateReg istrantDetails( registrantId,us erName,Registan tObj,dsCompenOr g,selectedCount iesArr))
        >>
        >> {
        >>
        >> Response.Redire ct(TrainingURL, false);
        >>
        >> }
        >>
        >> }
        >>
        >> else
        >>
        >> {
        >>
        >> if(WRTSPublic.D ataAccess.DataA ccess.InsertReg istrantDetails( RegistantObj,ds CompenOrg,selec tedCountiesArr) )
        >>
        >> {
        >>
        >> Response.Redire ct(Introduction URL,false);
        >>
        >> }
        >>
        >> }
        >>
        >> }
        >>
        >> catch(Exception ex)
        >>
        >> {
        >>
        >> ExceptionCatch. RegisterLog(ex. Message);
        >>
        >> }
        >>
        >> }
        >>
        >>
        >>[/color][/color]


        Comment

        • offwhite@gmail.com

          #5
          Re: response redirection not working - HELP!

          Is authentication involved here? It sounds like it does not want to
          leave the current page no matter what you do. You may want to try
          calling...

          FormsAuthentica tion.RedirectFr omLoginPage

          You can find more here...

          http://msdn2.microsoft.com/en-US/lib...loginpage.aspx

          Comment

          • ODAN

            #6
            Re: response redirection not working - HELP!

            We found a solution to this problem. It was the smartnav. We disable the
            smartnav before the reponse.redirec t statement and voila, it works.
            "ODAN" <oludan@hotmail .com> wrote in message
            news:erRHg%232f GHA.4004@TK2MSF TNGP04.phx.gbl. ..[color=blue]
            > We are testing a ASP.NET application in Visual Studion 2003 and written in
            > C#. One of the pages that register new users on this application fails to
            > redirect to another page when the button is clicked. On the page there is
            > a button that has been code to save to database and also redirect to the
            > login page. When you fill out the form and click on this page, it saves
            > the data into the database but it does nothing after that, it just sits
            > there on the same page. We checked everytihng in the code and the
            > web.config file. The web applicaiton is working good on the development
            > workstation (Win XP), but not working on the server running Windows Server
            > 2003 IIS6. Please help? Any ideas?
            >
            >
            > try
            >
            > {
            >
            > if(Session["Registrant ID"]!=null)
            >
            > {
            >
            > divusername.Vis ible=false;
            >
            > string registrantId=Se ssion["Registrant ID"].ToString;
            >
            > string userName=Sessio n["username"].ToString();
            >
            > if(WRTSPublic.D ataAccess.DataA ccess.UpdateReg istrantDetails( registrantId,us erName,Registan tObj,dsCompenOr g,selectedCount iesArr))
            >
            > {
            >
            > Response.Redire ct(TrainingURL, false);
            >
            > }
            >
            > }
            >
            > else
            >
            > {
            >
            > if(WRTSPublic.D ataAccess.DataA ccess.InsertReg istrantDetails( RegistantObj,ds CompenOrg,selec tedCountiesArr) )
            >
            > {
            >
            > Response.Redire ct(Introduction URL,false);
            >
            > }
            >
            > }
            >
            > }
            >
            > catch(Exception ex)
            >
            > {
            >
            > ExceptionCatch. RegisterLog(ex. Message);
            >
            > }
            >
            > }
            >
            >[/color]


            Comment

            Working...