I believe that in the page_load event, the viewstate of the controls has not
been restored. So during the page_load, your textbox has no value.
Why do you need to execute the search in the page_load instead of the
on_click?
Regards
Nick
"VT Venkatesh" <ve...@vsnl.com> wrote in message
news:4896...@newsgroups.borland.com...
> The user inputs the search text in the home page & the search results
> have to be displayed in another page (both use the same user control
> with a text box & a search button) & for that to happen i need to run
> the search related code in the page load event.
> Is there any other way to run it?
Why are you using a redirect page? You should have the button call the
destination page directly using the PostbackUrl property of the
button.
--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com
Venkatesh
> Thanks for the tip.How does one then pass the search value?.I am passing
> it now as a queryString along with the redirect
Look at the help for PostbackUrl and the associated properties, it
should explain what you need to look at.
> Look at the help for PostbackUrl and the associated properties, it
> should explain what you need to look at.
>
I tried to use the concept from
http://msdn.microsoft.com/en-us/library/6c3yckfw.aspx
I declared a property searchString in searchpage.aspx & tried to access
the property searchString in searchpageResults.aspx through
previouspage.searchString
How ever searchString property does not show up in searchpageResults.aspx
I have declared the previouspageType directive in searchpageResults.aspx
Venkatesh
> How ever searchString property does not show up in searchpageResults.aspx
> I have declared the previouspageType directive in searchpageResults.aspx
This is not something people commonly do so code completion might not
show you the properties. If you type the property in it should
compile, otherwise do something like:
(PreviousPage as SearchPage).SearchString
This is not working at all.Even (PreviousPage as
SearchPage).SearchString does not compile
Even the diective <%@ PreviousPageType VirtualPath = "~/SearchPage.aspx"
%> is showing an error 'Incomplete tag found at line 1' though this is
at line 3.when i remove the directive the error goes away
Is this a bug with the editor ?
Venkatesh
>
> This is not working at all.Even (PreviousPage as
> SearchPage).SearchString does not compile
> Even the diective <%@ PreviousPageType VirtualPath = "~/SearchPage.aspx"
> %> is showing an error 'Incomplete tag found at line 1' though this is
> at line 3.when i remove the directive the error goes away
> Is this a bug with the editor ?
Possibly, I have never seen anyone try to use this directive in
Delphi.NET before. You can skip the directive and just typecast
PreviousPage to whatever you need. Other solutions that might work
are:
* Add a button click event to SearchPage.aspx, IIRC, if you refer to
PreviousPage in SearchPageResults then it will cause the event to
fire.
* The article you linked to also provides a solution using
PreviousPage.FindControl
> Possibly, I have never seen anyone try to use this directive in
> Delphi.NET before. You can skip the directive and just typecast
> PreviousPage to whatever you need. Other solutions that might work
> are:
> * Add a button click event to SearchPage.aspx, IIRC, if you refer to
> PreviousPage in SearchPageResults then it will cause the event to
> fire.
> * The article you linked to also provides a solution using
> PreviousPage.FindControl
>
PreviouPage always returns nil in delphi.net.
I tried it in VS & it works great.How to confirm whether previouspage
works though the the word is recognised & it compiles ok.
Can some one test this out ?
Venkatesh