I want to transfer to a search page from my default page to
SearchResults.aspx and I want to pass a variable named strSearch.
So far I have:
Dim strSearch as string
strSearch = tbSearch.text
Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")
It is throwing this error:
Compiler Error Message: BC30648: String constants must end with a
double quote
I do not understand. Help anyone?Here's a nice, simple way to pass values from one page to another:
(VB.NET code)
'Add data to the context object before transferring
Context.Items("myParameter") = x
Server.Transfer("WebForm2.aspx")
Then, in WebForm2.aspx:
'Grab data from the context property
Dim x as Integer = CType(Context.Items("myParameter"),Integer)
Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/i...te/default.aspx
http://www.aspalliance.com/kenc/passval.aspx
http://www.dotnetbips.com/displayarticle.aspx?id=79
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Sparky Arbuckle" <twa@.secureroot.com> wrote in message
news:1108528696.261435.215090@.f14g2000cwb.googlegroups.com...
>I want to transfer to a search page from my default page to
> SearchResults.aspx and I want to pass a variable named strSearch.
> So far I have:
> Dim strSearch as string
> strSearch = tbSearch.text
> Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")
> It is throwing this error:
> Compiler Error Message: BC30648: String constants must end with a
> double quote
> I do not understand. Help anyone?
>
anyone else got any suggestions?
Hi,
Your Server.Transfer line should be: -
Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch)
HTH
regards
Joyjit
"Sparky Arbuckle" <twa@.secureroot.com> wrote in message
news:1108528696.261435.215090@.f14g2000cwb.googlegroups.com...
> I want to transfer to a search page from my default page to
> SearchResults.aspx and I want to pass a variable named strSearch.
> So far I have:
> Dim strSearch as string
> strSearch = tbSearch.text
> Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")
> It is throwing this error:
> Compiler Error Message: BC30648: String constants must end with a
> double quote
> I do not understand. Help anyone?
>
On 15 Feb 2005, "Sparky Arbuckle" <twa@.secureroot.com> postulated in
news:1108532798.517363.148550@.c13g2000cwb.googlegroups.com:
> anyone else got any suggestions?
>
Why the extra quote at the end of the line?
-- ip
0 comments:
Post a Comment