By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,357 Members | 982 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,357 IT Pros & Developers. It's quick & easy.

declaration expected

P: n/a
Hi All,

I have a page which I want to accept an ID on the querystring - I'm trying
to get this ID into a hidden form field.

I have the following code at the top of my page:

Line 5: <script language="VB" runat="server">
Line 6: dim ResortID as integer
Line 7: ResortID = Request.QueryString("resortid")
Line 8: </script>

I get this error:

Compiler Error Message: BC30188: Declaration expected.

What have I done wrong?

I hear alot of talk about using code behind page for everything, but how
would I grab querystring vars using code behind?

Regards,
Simon.
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
i prefer to directly use
Requst("variablename") to grab the variable.

if you double click the page it should open the codebehind class file on
Page_Load event handler.

here declare something like

dim ResortID as integer

if Request("resortid") <> "" then
ResortID = cint(Request("resortid"))
end if

i dont use VB.NET so dont know if you have cint any more.
In C# we tend to use int.parse(string) to get int convesion. you can also
use Convert.ToInt32(variable) to get a int

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Simon Harris" <to***********@makes-you-fat.com> wrote in message
news:e1**************@TK2MSFTNGP12.phx.gbl...
Hi All,

I have a page which I want to accept an ID on the querystring - I'm trying
to get this ID into a hidden form field.

I have the following code at the top of my page:

Line 5: <script language="VB" runat="server">
Line 6: dim ResortID as integer
Line 7: ResortID = Request.QueryString("resortid")
Line 8: </script>

I get this error:

Compiler Error Message: BC30188: Declaration expected.

What have I done wrong?

I hear alot of talk about using code behind page for everything, but how
would I grab querystring vars using code behind?

Regards,
Simon.

Nov 18 '05 #2

P: n/a
Thank you! Now working, and in the code behind as it 'should be'

"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:un*************@TK2MSFTNGP14.phx.gbl...
i prefer to directly use
Requst("variablename") to grab the variable.

if you double click the page it should open the codebehind class file on
Page_Load event handler.

here declare something like

dim ResortID as integer

if Request("resortid") <> "" then
ResortID = cint(Request("resortid"))
end if

i dont use VB.NET so dont know if you have cint any more.
In C# we tend to use int.parse(string) to get int convesion. you can also
use Convert.ToInt32(variable) to get a int

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Simon Harris" <to***********@makes-you-fat.com> wrote in message
news:e1**************@TK2MSFTNGP12.phx.gbl...
Hi All,

I have a page which I want to accept an ID on the querystring - I'm
trying
to get this ID into a hidden form field.

I have the following code at the top of my page:

Line 5: <script language="VB" runat="server">
Line 6: dim ResortID as integer
Line 7: ResortID = Request.QueryString("resortid")
Line 8: </script>

I get this error:

Compiler Error Message: BC30188: Declaration expected.

What have I done wrong?

I hear alot of talk about using code behind page for everything, but how
would I grab querystring vars using code behind?

Regards,
Simon.


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.