2

Example: url is http://www.mydoman.com/test.aspx/88

I click an asp:Button which cause a postback, but now the url comes up:

www.mydoman.com/test.aspx/test.aspx

There is nothing special in the button, just id and runat.

This only happens when I start with the "/88" in the starting url?

Why, and how can I prevent the duplication. After the postback I want the url to be the same as when started.

BlooSki
  • 79
  • 6

1 Answers1

0

We probably need more detail to help here.

For example: What is the definition of your form, and do you use any sort of routing?

I don't believe http://www.mydoman.com/test.aspx/88 is valid syntax though, shouldn't it be http://www.mydoman.com/88 or http://www.mydoman.com/test.aspx?ID=88 ?

Bravax
  • 10,453
  • 7
  • 40
  • 68
  • Firstly, I inherited this rather large unfinished and bastardized site and am not totally familiar with the workings. But I simplified this issue in a test page. It is not an MVC site, but they seemed to be used the "/88" type notation to pass a project number from one page to another. Not sure why they didn't use "?pid-88" but I know you can retrieve the information with a Request. – BlooSki Nov 10 '10 at 19:08
  • I'd look into the custom routing you mentioned, as that might be the cause of this. – Bravax Nov 10 '10 at 19:13
  • So its seems like some kind of custom type routing. Still I don't see why it should make the postback duplicate the page reference. The form for testing is very simple: `
    `
    – BlooSki Nov 10 '10 at 19:13
  • So, you are saying that something like a handler hiding away somewhere might be affecting standard vanilla looking pages? – BlooSki Nov 10 '10 at 19:15
  • Possibly, or it could be a red herring. Create a completely new project and move your code to that and see what happens. – Bravax Nov 10 '10 at 19:20
  • OK, I did it in totally unrelated environment and it did the same thing. So its not related to routing or custom handlers. – BlooSki Nov 10 '10 at 20:50
  • However, I forgot to mention, that in this case when it repeated the page name in the url, it did generate a 'The resource cannot be found' error. – BlooSki Nov 10 '10 at 20:53
  • Excellent! What resource? try and step through that code and see what it is doing. – Bravax Nov 10 '10 at 21:26
  • ok... add method="post" to your form declaration... but otherwise step through the code and see what it's doing... as you can see i'm running out of ideas. – Bravax Nov 10 '10 at 21:36
  • Method="post" makes no difference. There is no code really. Its real simple to duplicate. In VS, create a web site. Add a button, with a click event. Then just run by entering the url with a "/88" and click the button. – BlooSki Nov 10 '10 at 22:58
  • I tried that, and it worked with no problems. I did this in VS2010. – Bravax Nov 11 '10 at 14:59
  • I just tried it with VS2010 and you are right. With the development server it works on VS2010. But the same code on VS2008 doesn't work. And more importantly, my original example came from the web with IIS 6.0, and that doesn't work. So this is beginning to look like its a quirk with how the web server handles the "/88" on a postback. – BlooSki Nov 11 '10 at 22:19