locked
PostBack appends to url? RRS feed

  • Question

  • User964832528 posted

    I have a page that has a button that causes a post back, however, once the post back is finished, the url now basically has my entire javascript file appended to the end of it. This is definitely a result ASP.NET's button control as I've tested it using normal buttons. What can I do resolve this?


    Example:


    Normal url:

    http://localhost:2950/wiki/wikiEditPage.aspx?ecv=5WIAy8e2op0ZY6aI2uZpG%2b8Tku%2bKoOSF


    After post back:

    http://localhost:2950/wiki/wikiEditPage.aspx?ecv=5WIAy8e2op0ZY6aI2uZpG%2b8Tku%2bKoOSF#ToString=function%20%28%29%20{%0A%20%20%20%20return%20%22Object%22%3B%0A}&Type=Object&Inherit=function%20%28type%29%20{%0A%20%20%20%20this._Inherit%20%3D%20type%3B%0A%20%20%20%20switch%20%28arguments.length%29%20{%0A%20%20%20%20%20%20case%201%3A%0A%20%20%20%20%20%20%20%20this._Inherit%28%29%3B%0A%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20case%202%3A%0A%20%20%20%20%20%20%20%20this._Inherit%28arguments[1]%29%3B%0A%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20case%203%3A%0A%20%20%20%20%20%20%20%20this._Inherit%28arguments[1]%2C%20arguments[2]%29%3B%0A%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20case%204%3A%0A%20%20%20%20%20%20%20%20this._Inherit%28arguments[1]%2C%20arguments[2]%2C%20arguments[3]%29%3B%0A%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20case%205%3A%0A%20%20%20%20%20%20%20%20this._Inherit%28arguments[1]%2C%20arguments[2]%2C%20arguments[3]%2C%20arguments[4]%29%3B%0A%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20default%3A%3B%0A%20%20%20%20}%0A%20%20%20%20delete%20this._Inherit%3B%0A}&GetType=function%20%28%29%20{%0A%20%20%20%20return%20this.Type%3B%0A}&IsEqual=function%20%28x%29%20{%0A%20%20%20%20return%20this%20%3D%3D%20x%3B%0A}

    Friday, February 26, 2010 8:56 AM

Answers

  • User151468730 posted

    Hi,

    Use HttpUtility.UrlDecode() to resolve it.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, February 27, 2010 6:04 AM
  • User915387828 posted

    Hi DahrkDaiz,

    I guess that you take the get submit, so it will add plus string.

    You can take post submit.

    The form is always submitted to the page itself. If you specify an action attribute, it is ignored. If you omit the method attribute, it will be set to method="post" by default. Also, if you do not specify the name and id attributes, they are automatically assigned by ASP.NET.

     <form id="form1" runat="server" method="post">

    Please check the following link:

    http://msdn.microsoft.com/en-us/library/bb628610.aspx

    http://www.w3schools.com/aspnet/aspnet_forms.asp

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 3, 2010 1:19 AM

All replies

  • User-451260051 posted

    Can you post your Button code and the click event code?

    Friday, February 26, 2010 3:41 PM
  • User151468730 posted

    Hi,

    Use HttpUtility.UrlDecode() to resolve it.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, February 27, 2010 6:04 AM
  • User915387828 posted

    Hi DahrkDaiz,

    I guess that you take the get submit, so it will add plus string.

    You can take post submit.

    The form is always submitted to the page itself. If you specify an action attribute, it is ignored. If you omit the method attribute, it will be set to method="post" by default. Also, if you do not specify the name and id attributes, they are automatically assigned by ASP.NET.

     <form id="form1" runat="server" method="post">

    Please check the following link:

    http://msdn.microsoft.com/en-us/library/bb628610.aspx

    http://www.w3schools.com/aspnet/aspnet_forms.asp

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 3, 2010 1:19 AM