Automatically Getting redirected to same link with query parameter attached to the URL while using an asp:Button or asp:LinkButton, this happens even if there's no funtion call.
Hi, I am a .net developer working on ASP 2.0 with C# 2 and VB. Recently I tried adding an asp:button on one of the page but noticed a weird thing happening on all the pages that work with querystring, If there is a asp:Button or asp:LinkButton and if it is clicked the user will be redirect to same page with the querystring parameter appearing in the URL.
below is the ss of test page (**peak **is the querystring-parameter): before clicking on the button
below is the ss after the button is getting clicked (**peak **is the querystring-parameter): after clicking on the button
this is the rule I've added in the web.config:
<rule name="thisistestpage" stopProcessing="true">
<match url="^test-page/(.+)$" />
<conditions>
<add input="{URL}" pattern="^/test-page/(.+)$" />
</conditions>
<action type="Rewrite" url="testing.aspx?val={R:1}" appendQueryString="true" logRewrittenUrl="true" />
</rule>
I am using a asp:button but and no function is getting called on the button click event still there's a redirection and I am clueless why this is happening. this is not happening if I use button ,only server controls are causing the issue. Please help me out here, Thank you in advance.