Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How edit my URL on button click

How edit my URL on button click

Scheduled Pinned Locked Moved C#
comtutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Exelioindia
    wrote on last edited by
    #1

    Hi all, Any one suggest me how to edit my url and submit the page on button click with out using Response.redirect. for eg: www.mysite.com/default.aspx this is my page, on button click the page should submit and reload, the url should look like www.mysite.com/default.aspx?step=1 (no response.redirect, because i am losing the viewstate even though i set the EnableViewState="true") Thank you

    Know is Drop, Unknown is Ocean

    S D 2 Replies Last reply
    0
    • E Exelioindia

      Hi all, Any one suggest me how to edit my url and submit the page on button click with out using Response.redirect. for eg: www.mysite.com/default.aspx this is my page, on button click the page should submit and reload, the url should look like www.mysite.com/default.aspx?step=1 (no response.redirect, because i am losing the viewstate even though i set the EnableViewState="true") Thank you

      Know is Drop, Unknown is Ocean

      S Offline
      S Offline
      Simon P Stevens
      wrote on last edited by
      #2

      You'll probably get better answers over in the ASP.NET forum[^].

      Simon

      1 Reply Last reply
      0
      • E Exelioindia

        Hi all, Any one suggest me how to edit my url and submit the page on button click with out using Response.redirect. for eg: www.mysite.com/default.aspx this is my page, on button click the page should submit and reload, the url should look like www.mysite.com/default.aspx?step=1 (no response.redirect, because i am losing the viewstate even though i set the EnableViewState="true") Thank you

        Know is Drop, Unknown is Ocean

        D Offline
        D Offline
        Dominic Goulet
        wrote on last edited by
        #3

        Hello, What you are asking is to change to url, while doing a postback event. I'm sorry, this can't happen in a fashionly manner. When you use a redirection (or a hyperlink -- so whenever you modify the url), you will lost the viewstate. Why is that so? Because viewstate is stored in a form value. It is actually stored into a hidden field of the page. If you change the url, the data in this field is lost because you are causing a page change, not a page postback event. You should post here what you want to do, we can help you manage the situation in another way. One suggestion here could be that you use the ViewState object instead of a query string parameter to manage the current step of your wizard.

        ______________________ Dominic Goulet FroggedSoft

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups