P
panik
Hi,
I have a Control, a SearchBox class, that is derived from UserControl.
It is placed inside another UserControl (a page structure) that is placed
inside a custom page class (derived from Page).
All controls are added programmatically (Controls.Add())
In the SearchBox Control, I have an ImageButton, with an
ImageClickEventhandler attached to it. The EventHandler is defined in the
SearchBox class.
I placed two lines in the ImageClickEventhandler for the search button:
1. a Response.Write to give me feedback
2. a Server.Transfer to let the page you're on switch to the search results
page.
The Response.Write is fired on each click. The Server.Transfer is only fired
when you click a second time on the button.
The scenario goes like this:
You open the homepage.
You click Search but get the Homepage back (the url remains default.aspx)
You click again and get the searchresults page. (the url switches to
search.aspx or whatever the searchresult page's URI is)
How is this happening? I tried to catch errors, but didn't get any.
Is the only way to use this SearchBox control on every single page in an
asp.net application to define an additional html form element with the
searchresults page as action attribute?
thanks for your help,
Vincent
I have a Control, a SearchBox class, that is derived from UserControl.
It is placed inside another UserControl (a page structure) that is placed
inside a custom page class (derived from Page).
All controls are added programmatically (Controls.Add())
In the SearchBox Control, I have an ImageButton, with an
ImageClickEventhandler attached to it. The EventHandler is defined in the
SearchBox class.
I placed two lines in the ImageClickEventhandler for the search button:
1. a Response.Write to give me feedback
2. a Server.Transfer to let the page you're on switch to the search results
page.
The Response.Write is fired on each click. The Server.Transfer is only fired
when you click a second time on the button.
The scenario goes like this:
You open the homepage.
You click Search but get the Homepage back (the url remains default.aspx)
You click again and get the searchresults page. (the url switches to
search.aspx or whatever the searchresult page's URI is)
How is this happening? I tried to catch errors, but didn't get any.
Is the only way to use this SearchBox control on every single page in an
asp.net application to define an additional html form element with the
searchresults page as action attribute?
thanks for your help,
Vincent