II am getting a build error for the folowing statement:
String sGetVarVal = Request.QueryString("myvar");
error:
System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
was expected
I though that the statement is correct!! have seen it a lot of times. Can
anyone help on this? Thanks
Carlos.Use [ ] - this squre brackets instead of this ( )
Regards
Thangam,
"Carlos" wrote:
> Hi all,
> II am getting a build error for the folowing statement:
> String sGetVarVal = Request.QueryString("myvar");
> error:
> System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
> was expected
> I though that the statement is correct!! have seen it a lot of times. Can
> anyone help on this? Thanks
>
> Carlos.
>
>
>
Carlos,
Have you just moved from vb to vc#?
String sGetVarVal = Request.QueryString["myvar"];
Eliyahu
"Carlos" <ch_sanin@.yahoo.com> wrote in message
news:eLvJ0mrDFHA.1668@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> II am getting a build error for the folowing statement:
> String sGetVarVal = Request.QueryString("myvar");
> error:
> System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
> was expected
> I though that the statement is correct!! have seen it a lot of times. Can
> anyone help on this? Thanks
>
> Carlos.
>
>
Try String sGetVarVal = Request.QueryString["myvar"];
You're using VB syntax in C# code.
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
=====================
"Carlos" <ch_sanin@.yahoo.com> wrote in message
news:eLvJ0mrDFHA.1668@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> II am getting a build error for the folowing statement:
> String sGetVarVal = Request.QueryString("myvar");
> error:
> System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
> was expected
> I though that the statement is correct!! have seen it a lot of times. Can
> anyone help on this? Thanks
>
> Carlos.
>
>
As others have pointed out, C# cleans up the ambiguity with respect to
functions() and arrays[]
If, as others have suggested, you are moving from VB.Net to C#, you might
want to check out:
http://www.harding.edu/USER/fmccown...comparison.html
Other than that my follow up to this thread has been little more than a
"what he said" ...but makes me feel nonetheless special :)
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Carlos" <ch_sanin@.yahoo.com> wrote in message
news:eLvJ0mrDFHA.1668@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> II am getting a build error for the folowing statement:
> String sGetVarVal = Request.QueryString("myvar");
> error:
> System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
> was expected
> I though that the statement is correct!! have seen it a lot of times. Can
> anyone help on this? Thanks
>
> Carlos.
>
>
0 comments:
Post a Comment