tags:

views:

230

answers:

2

I have multiple subdirectories in my solution that have default.aspx pages in them, so when I use the url:

http://www.mysite.com/products/

where products is a subdirectory stated above, it shows the contents of the default.aspx page located within the directory.

Whenever an initial postback occurs on the page the url changes to:

http://www.mysite.com/products/default.aspx

the event that caused the postback is fired, but no results from that event are produced i.e. (Gridview not bound with new results)

If I initially navigate to the page

http://www.mysite.com/products/default.aspx

then everything occurs as expected on the first shot. So I am assuming it has something to do with the URL im using and not specifically the code?

Any feedback on this issue would be appreciated.

Well this is executed from onclick events for buttons I have in a listview it hits the last line but does not swap the text (url changes):

Protected Sub PrepareNewReason(ByVal sender As Object, ByVal e As EventArgs)
    ListView1.EditIndex = -1
    If CType(sender, Control).ID = "addReason1" Then
        ' We are on top of the list show entry row on top
        ListView1.InsertItemPosition = InsertItemPosition.FirstItem
    Else
        ListView1.InsertItemPosition = InsertItemPosition.LastItem
    End If
    ListView1.FindControl("addReason1").Visible = False
    ListView1.FindControl("addReason2").Visible = False
    Label1.Text = "This Line was hit"
End Sub
+1  A: 

Not sure if this will help. May be a setting in the Web.Config.

madcolor
Thank you! Turns out SmartNavigation was set to true in my Web.Config File.
GBriones
+2  A: 

This probably has nothing to do with the URL changing. Try a simpler change. Put a label on the page, and change the label text from the event that fires the PostBack.

John Saunders
Yeah I tried it. Just does the same. Hit's the break point where it swaps the text. Changes the URL to have "default.aspx". But the label text is what it started with.
GBriones
Sorry, what breakpoint. Maybe its time to show some code?
John Saunders
I'm sorry, swaps what text? Is the label declared in markup? Is the original text different from what you're changing it to? Is the label ever referenced by the code? Is it visible?
John Saunders
Swaps the text of the Label. Orignal Text is "Label1". Yes. Yes
GBriones
I can't imagine why this doesn't work. It doesn't look special. Maybe you could create a simpler version of the page and try to reproduce it.Is the label in the ListView or outside of it?
John Saunders
Yeah. It is doing this from the initial postback anytime i Use a URL without /default.aspx. The label is outside of it.
GBriones
Ok, so if you create a foo.aspx page just like this, then it works?
John Saunders
I created a foo subdirectory with a default.aspx page in it. default.aspx has just a button and a label on it. button click event has code to swap text of label. But same results. Takes two tries. First try changes the URL.
GBriones
I meant a foo.aspx page, not a subfolder.
John Saunders
Then yes foo.aspx works.
GBriones
Thank you for your help John. My problem is solved.
GBriones