Refresh Page. Shouldn't this be simple?!

Discussion in 'ASP .Net' started by Shapper, May 2, 2005.

  1. Shapper

    Shapper Guest

    Hello,

    I have the function changeCulture(culture As String) in all my .aspx web
    pages. This functions changes Threat Culture among other actions.

    So the new culture takes effect I need to refresh the current page
    preserving the URL which can contain URL parameters (query).

    I tried 2 solutions:

    Dim refreshURL As String = this.GetType().Name
    Response.Redirect(refreshURL.Replace("_", "."))

    ERROR:
    Name 'this' is not declared.

    AND

    Response.Redirect(Request.Url.AbsoluteUri)

    ERROR:
    Redirection limit for this URL exceeded.
    Unable to load the requested page.
    This may be caused by cookies that are blocked.


    Anyway, I don't even know if these are the best ways to do it.
    Can someone help me out?

    Refreshing current page should be easy...or maybe not. :)

    Thanks,
    Miguel
     
    Shapper, May 2, 2005
    #1
    1. Advertisements

  2. see inline

    'this' is the C# keyword; as you're using VB.NET, you'd use the word 'Me'
    instead
    this is an infinite loop because you're pry doing this every time the page
    is loaded (not checking IsPostBack, or somehow preventing the loop on a
    GET request).

    I'm curious that you'll get the same error if you fix the 1st solution as
    well. I think the wrong keyword is keeping you from getting the same
    error there.
     
    Craig Deelsnyder, May 3, 2005
    #2
    1. Advertisements

  3. Shapper

    Shapper Guest

    Yes you are right.

    I got the same error as soon as I changed This to Me.

    "This is an infinite loop because you're pry doing this every time the
    page is loaded (not checking IsPostBack, or somehow preventing the loop
    on a GET request)."

    How can I solve this?

    Thanks,
    Miguel
     
    Shapper, May 3, 2005
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.