Showing posts with label build. Show all posts
Showing posts with label build. Show all posts

Wednesday, March 28, 2012

trivial ? build error

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.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.
>
>
>

trivial ? build error

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.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.
>
>

Thursday, March 22, 2012

Trouble with sequence of page build.

Instead of using Hyperlinks and URL / Response.QueryString() parameters to
pass state around in my app, I am using LinkButtons with a corresponding
command event and command arguments.
This page has LinkButtons in a menu down the left hand side, that when
clicked causes the main content of the page to change. The main content of
the page has linkbuttons as well. I am having trouble with the linkbuttons
in the maincontent area keeping their associated command event wired
together.
The linkbuttons in the left menu get built in the page load of the initial
load and all subsequent postbacks (these work fine).
When a left menu linkbutton is clicked it causes a postback,
Page_Load()
BuildLeftMenu() is run in page_load
I don't run BuildMainContent() in the page_load because I don't have the new
TopicID yet.
MyLinkButton_Command() fires next, where I capture the command argument
which tells me the TopicID which I set as a session var and then call
BuildMainContent()
BuildMainContent() fires which grabs the TopicID from the Session and builds
the maincontent linkbuttons .
The server returns the page to me and the maincontent linkbuttons exist, but
are not wired to their commandevents. Meaning when I click on them nothing
happens.
****************************************
***********
Now if I put the BuildMainContent() in the page_load so it builds in the
postback, everything works okay.
My question is, why aren't the commandevents wired to the linkbuttons, when
I have clearly wired them up in the BuildMainContent() method?
Thanks.
TPS.Hi TPS,
As for the postback issue on the dynamic controls you mentioned, here are
my understandings:
The Controls added in the "BuildMainContent()" method is called in other
controls(built in BuildLeftMenu() in Page_Load)'s post back event ,yes?
That means the maincontent's Linkbutton's postback event handler are wireup
when page processing the postback event rather than before it. So of course
it can 't be fired. And when you move the BuildMainContent() to Page_Load,
their events will be fired.
In fact, as for dynamically created controls, the following two things
should be noticed:
1.Dynamic control should be created everytime page is requested (both the
intial load and the sequential ...). We recommand that we create and add
them in page's OnInit .(in Page_Load is also ok)
2. If the control need to register postback event handler, the handler
should be wireup before the page processing the postback event.
Generally in Page's Init or Load event.
And here is good tech article which has mentioned the things above. I
believe it'll help on undertanding them:
#Understanding ASP.NET View State
http://msdn.microsoft.com/library/d...-us/dnaspp/html
/viewstate.asp
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Steven, thanks for your reply.
I have read for hours and still can't seem to answer my question.
My problem is my LinkButton event handler fires "AFTER" the page has been
built. When the event handler fires, that is where I am getting "TopicID"
from the command arguement. I am using the new TopicID to populate my
LinkButtons, but it is too late because the page has already been built!
Ideas?
Thanks,
TPS
"Steven Cheng[MSFT]" <v-schang@.online.microsoft.com> wrote in message
news:hzkuTgreEHA.720@.cpmsftngxa06.phx.gbl...
> Hi TPS,
> As for the postback issue on the dynamic controls you mentioned, here are
> my understandings:
> The Controls added in the "BuildMainContent()" method is called in other
> controls(built in BuildLeftMenu() in Page_Load)'s post back event ,yes?
> That means the maincontent's Linkbutton's postback event handler are
wireup
> when page processing the postback event rather than before it. So of
course
> it can 't be fired. And when you move the BuildMainContent() to Page_Load,
> their events will be fired.
> In fact, as for dynamically created controls, the following two things
> should be noticed:
> 1.Dynamic control should be created everytime page is requested (both the
> intial load and the sequential ...). We recommand that we create and add
> them in page's OnInit .(in Page_Load is also ok)
> 2. If the control need to register postback event handler, the handler
> should be wireup before the page processing the postback event.
> Generally in Page's Init or Load event.
> And here is good tech article which has mentioned the things above. I
> believe it'll help on undertanding them:
> #Understanding ASP.NET View State
>
http://msdn.microsoft.com/library/d...-us/dnaspp/html
> /viewstate.asp
>
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
>
Hi TPS,
I've seen for new post discussing on the same problem in this group named
"Can EventHandler fire in Page_PreRender event".
I've posted my reply in the thread. I'd appreciate if you have a look
there.
In addition, if you feel it convenient that we continue to discussing in
one of the two threads, please feel free to followup in either one. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Trouble with sequence of page build.

Instead of using Hyperlinks and URL / Response.QueryString() parameters to
pass state around in my app, I am using LinkButtons with a corresponding
command event and command arguments.

This page has LinkButtons in a menu down the left hand side, that when
clicked causes the main content of the page to change. The main content of
the page has linkbuttons as well. I am having trouble with the linkbuttons
in the maincontent area keeping their associated command event wired
together.

The linkbuttons in the left menu get built in the page load of the initial
load and all subsequent postbacks (these work fine).

When a left menu linkbutton is clicked it causes a postback,

Page_Load()
BuildLeftMenu() is run in page_load

I don't run BuildMainContent() in the page_load because I don't have the new
TopicID yet.

MyLinkButton_Command() fires next, where I capture the command argument
which tells me the TopicID which I set as a session var and then call
BuildMainContent()

BuildMainContent() fires which grabs the TopicID from the Session and builds
the maincontent linkbuttons .

The server returns the page to me and the maincontent linkbuttons exist, but
are not wired to their commandevents. Meaning when I click on them nothing
happens.

************************************************** *

Now if I put the BuildMainContent() in the page_load so it builds in the
postback, everything works okay.

My question is, why aren't the commandevents wired to the linkbuttons, when
I have clearly wired them up in the BuildMainContent() method?

Thanks.

TPS.Hi TPS,

As for the postback issue on the dynamic controls you mentioned, here are
my understandings:

The Controls added in the "BuildMainContent()" method is called in other
controls(built in BuildLeftMenu() in Page_Load)'s post back event ,yes?

That means the maincontent's Linkbutton's postback event handler are wireup
when page processing the postback event rather than before it. So of course
it can 't be fired. And when you move the BuildMainContent() to Page_Load,
their events will be fired.

In fact, as for dynamically created controls, the following two things
should be noticed:
1.Dynamic control should be created everytime page is requested (both the
intial load and the sequential ...). We recommand that we create and add
them in page's OnInit .(in Page_Load is also ok)

2. If the control need to register postback event handler, the handler
should be wireup before the page processing the postback event.
Generally in Page's Init or Load event.

And here is good tech article which has mentioned the things above. I
believe it'll help on undertanding them:

#Understanding ASP.NET View State
http://msdn.microsoft.com/library/d...-us/dnaspp/html
/viewstate.asp

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Steven, thanks for your reply.

I have read for hours and still can't seem to answer my question.

My problem is my LinkButton event handler fires "AFTER" the page has been
built. When the event handler fires, that is where I am getting "TopicID"
from the command arguement. I am using the new TopicID to populate my
LinkButtons, but it is too late because the page has already been built!

Ideas?

Thanks,
TPS

"Steven Cheng[MSFT]" <v-schang@.online.microsoft.com> wrote in message
news:hzkuTgreEHA.720@.cpmsftngxa06.phx.gbl...
> Hi TPS,
> As for the postback issue on the dynamic controls you mentioned, here are
> my understandings:
> The Controls added in the "BuildMainContent()" method is called in other
> controls(built in BuildLeftMenu() in Page_Load)'s post back event ,yes?
> That means the maincontent's Linkbutton's postback event handler are
wireup
> when page processing the postback event rather than before it. So of
course
> it can 't be fired. And when you move the BuildMainContent() to Page_Load,
> their events will be fired.
> In fact, as for dynamically created controls, the following two things
> should be noticed:
> 1.Dynamic control should be created everytime page is requested (both the
> intial load and the sequential ...). We recommand that we create and add
> them in page's OnInit .(in Page_Load is also ok)
> 2. If the control need to register postback event handler, the handler
> should be wireup before the page processing the postback event.
> Generally in Page's Init or Load event.
> And here is good tech article which has mentioned the things above. I
> believe it'll help on undertanding them:
> #Understanding ASP.NET View State
http://msdn.microsoft.com/library/d...-us/dnaspp/html
> /viewstate.asp
>
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi TPS,

I've seen for new post discussing on the same problem in this group named
"Can EventHandler fire in Page_PreRender event".

I've posted my reply in the thread. I'd appreciate if you have a look
there.
In addition, if you feel it convenient that we continue to discussing in
one of the two threads, please feel free to followup in either one. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx