1

I have an application that all the button over the page is do postback or maked encoded URL (like Yellow highlight) if clicked. How to disable that?

enter image description here

But if i make simple web form, with sample button. It working normally, not showing encoded url again. like this : enter image description here

Note : I use netframework 4.6

Bcktr
  • 208
  • 1
  • 8
  • 22

2 Answers2

3

it seems to me, that you make a "GET"-request. Please check the "method" attribute of your form-tag and set it to "POST" instead of "GET".

it should look like <form id="aspnetForm" runat="server" method="post" >

Regards, Sebastian

  • That's the piece of information I was missing, couldn't see why the POST info was in the URL, having seen that, it makes perfect sense +1 – War May 09 '16 at 09:42
2

You need to manually wire up your client code to build the url you want or just accept the way .Net does this for you.

but it looks like you are posting your viewstate in the url which is very odd.

What happens when you disable viewstate?

like these for example:

How to disable viewstate for aspx page?

How do I turn off viewstate for good?

Community
  • 1
  • 1
War
  • 8,539
  • 4
  • 46
  • 98
  • Hi Darth_Wardy thank you for your answer, but is still not working :( The button is not contain code, but the url is still shown like the picture above. Whats wrong with my application? Hope your answer. – Bcktr May 09 '16 at 09:05
  • the markup for your button will have something like onclick="__dopostback()" ... if you look at the rest of the page you can see that the code on the page is actually posting back a form, looking at the form tag will give you some hints but it may be that you have the webforms stuff setup in an odd manner, this behaviour is not normal. – War May 09 '16 at 09:15
  • Thank You very much for your answer – Bcktr May 09 '16 at 09:45