Jump to content

mvc .net question


sqlhelp

Recommended Posts

oka redirect function valla illa error vasthundi website browse chesthe  'Object moved to here'  

 public ActionResult Login(string URL)

        {

            URL = string.Format("{0}{1}", appHelper.redirectURL(), returnURL );

            Response.Redirect(URL);

            return null;

}

 

Please help .. google chesthe response.redirect lo problem antunaru but I tried other ways and nothing worked. 

 

 

Link to comment
Share on other sites

10 minutes ago, sqlhelp said:

oka redirect function valla illa error vasthundi website browse chesthe  'Object moved to here'  

 public ActionResult Login(string URL)

        {

            URL = string.Format("{0}{1}", appHelper.redirectURL(), returnURL );

            Response.Redirect(URL);

            return null;

}

 

Please help .. google chesthe response.redirect lo problem antunaru but I tried other ways and nothing worked. 

 

 

ikkada asalu nuvvu em cheyyali anukuntunnav, vere action ki call cheyyalaa? if yes  URL endhu ku just redirecttoaction('actionmethodname','controllername')

 

if no ithee asalu nuvvu akkada emcheyyalanukuntunnavoo clear gaa cheppu

Link to comment
Share on other sites

20 minutes ago, sqlhelp said:

oka redirect function valla illa error vasthundi website browse chesthe  'Object moved to here'  

 public ActionResult Login(string URL)

        {

            URL = string.Format("{0}{1}", appHelper.redirectURL(), returnURL );

            Response.Redirect(URL);

            return null;

}

 

Please help .. google chesthe response.redirect lo problem antunaru but I tried other ways and nothing worked. 

 

 

 

7 minutes ago, karna11 said:

ikkada asalu nuvvu em cheyyali anukuntunnav, vere action ki call cheyyalaa? if yes  URL endhu ku just redirecttoaction('actionmethodname','controllername')

 

if no ithee asalu nuvvu akkada emcheyyalanukuntunnavoo clear gaa cheppu

ee code nuvvu rasava ..vere vallu raste nuvvu modify chestunnava?

aa action result ki pass chesina url ki redirect cheyyali anukunta.. if so try replacing "returnURL" to "URL".

Link to comment
Share on other sites

26 minutes ago, sqlhelp said:

oka redirect function valla illa error vasthundi website browse chesthe  'Object moved to here'  

 public ActionResult Login(string URL)

        {

            URL = string.Format("{0}{1}", appHelper.redirectURL(), returnURL );

            Response.Redirect(URL);

            return null;

}

 

Please help .. google chesthe response.redirect lo problem antunaru but I tried other ways and nothing worked. 

 

 

redirect url should be URL or returnURL? check what is the value of URL..if the link is not constructed properly 

Link to comment
Share on other sites

46 minutes ago, sqlhelp said:

oka redirect function valla illa error vasthundi website browse chesthe  'Object moved to here'  

 public ActionResult Login(string URL)

        {

            URL = string.Format("{0}{1}", appHelper.redirectURL(), returnURL );

            Response.Redirect(URL);

            return null;

}

 

Please help .. google chesthe response.redirect lo problem antunaru but I tried other ways and nothing worked. 

 

 

I am not from .Net background. But as per your method it should return ActionResult object but you are returning null. Check with it once.

Link to comment
Share on other sites

28 minutes ago, karna11 said:

ikkada asalu nuvvu em cheyyali anukuntunnav, vere action ki call cheyyalaa? if yes  URL endhu ku just redirecttoaction('actionmethodname','controllername')

 

if no ithee asalu nuvvu akkada emcheyyalanukuntunnavoo clear gaa cheppu

ee actionresult vere degara call cheshtuna 

 

naku basic ga oka site browse chesthe  adi redirect avali login page ki then user login ayaka it should go back to the site that was browsed to. 

 

na code ila undi  

helper lo  

 

public String URL()

        {

           string redirectURL = WebConfigurationManager.AppSettings["LoginRedirection"];

           return redirectURL;

        }

 

        public String GetReturnUrl(Uri RequestURL)

        {

            String RedirectURL = String.Empty;

            if (RequestURL != null)

                RedirectURL = String.Format("{0}://{1}{2}", RequestURL.Scheme, RequestURL.Host, RequestURL.PathAndQuery);

                return RedirectURL;

        }

 

&&&

controller lo ila 

 public ActionResult Login(string URL)

        {

            URL = string.Format("{0}{1}", appHelper.URL(), URL);

            Response.Redirect(URL);

            return null;

}

public ActionResult subRedirector(int id)

             if (Request.Cookies["authentication"] == null)

            {

                return RedirectToAction("Login", "Index", appHelper.GetReturnUrl(Request.Url));

            }

   

 

Link to comment
Share on other sites

13 minutes ago, sqlhelp said:

I think URL value sariga pass avatledhu actionresult login function lo 

 

 public ActionResult Login(string URL)

    {

  Put a break point here           URL = string.Format("{0}{1}", appHelper.URL(), URL);

            Response.Redirect(URL);

            return null;

}

 

See the URL value before and after that statement... and post it here if there is no privacy issue.

Link to comment
Share on other sites

1 hour ago, sqlhelp said:

oka redirect function valla illa error vasthundi website browse chesthe  'Object moved to here'  

 public ActionResult Login(string URL)

        {

            URL = string.Format("{0}{1}", appHelper.redirectURL(), returnURL );

            Response.Redirect(URL);

            return null;

}

 

Please help .. google chesthe response.redirect lo problem antunaru but I tried other ways and nothing worked. 

 

 

Raja ne problem ento naku correct ga ardam kaledu kani . you can try the following

instead of returning null , you can return RedirectResult

use return Redirect(url);

and delete the following two lines

Response.Redirect(URL);

            return null;

a code nuvve rasthey mama anuko. inka evadu anna rasthey vadi deggariki elli mama anuko

Link to comment
Share on other sites

1 hour ago, stockdazzler said:

Raja ne problem ento naku correct ga ardam kaledu kani . you can try the following


instead of returning null , you can return RedirectResult

use return Redirect(url);

and delete the following two lines

Response.Redirect(URL);

            return null;

a code nuvve rasthey mama anuko. inka evadu anna rasthey vadi deggariki elli mama anuko

Evaro consultant rasadu .. ilaga chesthe Value cannot be null or empty. Parameter name: url   error vasthundi 

 

public ActionResult Login(string URL)

        {

            string redirectURL = "";

            redirectURL = string.Format("{0}{1}", appHelper.URL(), URL);

            return Redirect(redirectURL);

}

 

ila change chesi chusa 

 

Link to comment
Share on other sites

1 hour ago, Common Man said:

 

 public ActionResult Login(string URL)

    {

  Put a break point here           URL = string.Format("{0}{1}", appHelper.URL(), URL);

            Response.Redirect(URL);

            return null;

}

 

See the URL value before and after that statement... and post it here if there is no privacy issue.

URL lo ki em pass avatledhu 

sorry cant paste url here 

 

I am kinda new to this part of coding so silly mistakes chesthunana ani doubt 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...