Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Server.Transfer in User Control only fired on second click on button

Reply
Thread Tools

Server.Transfer in User Control only fired on second click on button

 
 
panik
Guest
Posts: n/a
 
      12-04-2003
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Button Click Event fired on second press? Asaf ASP .Net 1 04-08-2008 03:38 PM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Building Controls 1 05-28-2004 06:23 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net 2 05-25-2004 11:45 PM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Datagrid Control 0 05-25-2004 01:45 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Web Controls 0 05-25-2004 01:45 AM



Advertisments