} expected errors in VS2005

Discussion in 'ASP .Net' started by SenthilVel, Sep 9, 2006.

  1. SenthilVel

    SenthilVel Guest

    hi all

    i am opening an exiting 1.1 developed ASPX project in VS2005.

    i am getting more language editor problems :

    for example:
    for the below code :
    /// <summary>

    /// Next button on 'next/exit' line pressed

    /// </summary>

    private void nextButton_Click(object sender, System.EventArgs e) {

    protected Getsid = this.omSSBaseDropDownList.SelectedValue.Trim();

    }



    i get errors like :

    1.Error 1 } expected
    O:\Misys\apps\ifc\webroot\mic\aspx\IfaceWizLabG.aspx.cs 256 71 O:\...\aspx\

    2. Error 2 Invalid token '=' in class, struct, or interface member
    declaration A.aspx.cs 257 25 O:\...\aspx\

    3.Error 3 Invalid token '(' in class, struct, or interface member
    declaration .Baspx.cs 257 76 O:\...\aspx\


    Can any one let me know on how to over come these VS2005 errors?

    Thanks

    Senthil
    SenthilVel, Sep 9, 2006
    #1
    1. Advertising

  2. Why are you using protected inside of an event handler? You cannot declare a
    variable in that way inside of a routine.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    *************************************************
    Think outside the box!
    *************************************************
    "SenthilVel" <> wrote in message
    news:...
    > hi all
    >
    > i am opening an exiting 1.1 developed ASPX project in VS2005.
    >
    > i am getting more language editor problems :
    >
    > for example:
    > for the below code :
    > /// <summary>
    >
    > /// Next button on 'next/exit' line pressed
    >
    > /// </summary>
    >
    > private void nextButton_Click(object sender, System.EventArgs e) {
    >
    > protected Getsid = this.omSSBaseDropDownList.SelectedValue.Trim();
    >
    > }
    >
    >
    >
    > i get errors like :
    >
    > 1.Error 1 } expected
    > O:\Misys\apps\ifc\webroot\mic\aspx\IfaceWizLabG.aspx.cs 256 71
    > O:\...\aspx\
    >
    > 2. Error 2 Invalid token '=' in class, struct, or interface member
    > declaration A.aspx.cs 257 25 O:\...\aspx\
    >
    > 3.Error 3 Invalid token '(' in class, struct, or interface member
    > declaration .Baspx.cs 257 76 O:\...\aspx\
    >
    >
    > Can any one let me know on how to over come these VS2005 errors?
    >
    > Thanks
    >
    > Senthil
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    Cowboy \(Gregory A. Beamer\), Sep 9, 2006
    #2
    1. Advertising

  3. SenthilVel

    Hans Kesting Guest

    See inline

    > hi all
    >
    > i am opening an exiting 1.1 developed ASPX project in VS2005.
    >
    > i am getting more language editor problems :
    >
    > for example:
    > for the below code :
    > /// <summary>
    >
    > /// Next button on 'next/exit' line pressed
    >
    > /// </summary>
    >
    > private void nextButton_Click(object sender, System.EventArgs e) {
    >
    > protected Getsid = this.omSSBaseDropDownList.SelectedValue.Trim();


    A "type" is missing here (between "protected" and "Getsid"). I think it
    should be:
    string Getsid = ....
    or even (if "Getsid" is already declared elsewhere):
    Getsid = ....

    >
    > }
    >
    > i get errors like :
    >
    > 1.Error 1 } expected O:\Misys\apps\ifc\webroot\mic\aspx\IfaceWizLabG.aspx.cs
    > 256 71 O:\...\aspx\
    >
    > 2. Error 2 Invalid token '=' in class, struct, or interface member
    > declaration A.aspx.cs 257 25 O:\...\aspx\
    >
    > 3.Error 3 Invalid token '(' in class, struct, or interface member declaration
    > .Baspx.cs 257 76 O:\...\aspx\
    >
    > Can any one let me know on how to over come these VS2005 errors?
    >
    > Thanks
    >
    > Senthil
    Hans Kesting, Sep 11, 2006
    #3
  4. SenthilVel

    SenthilVel Guest

    Hi

    Thanks for the reply ...

    See i have this question now :

    The same file i used for this web application using vs2003 : CLR 1.1.

    now when i used VS2005 and CLR 2.0 , i get these errors when i have codes
    like below:

    private void DupFaccodeDelete_Click( object sender, System.EventArgs e ) {

    protected DeleteCacFacEventReq delReq = new DeleteCacFacEventReq();



    Error 1 } expected Sample.aspx.cs 253

    Is this way for declaring a protected member under a event function not
    allowed in C#2.0 ?

    IF so , do i need to to change the code which has these usage of protected
    ??

    Please let me know on this ..

    Thanks

    Senthil











    "Hans Kesting" <> wrote in message
    news:...
    > See inline
    >
    >> hi all
    >>
    >> i am opening an exiting 1.1 developed ASPX project in VS2005.
    >>
    >> i am getting more language editor problems :
    >>
    >> for example:
    >> for the below code :
    >> /// <summary>
    >>
    >> /// Next button on 'next/exit' line pressed
    >>
    >> /// </summary>
    >>
    >> private void nextButton_Click(object sender, System.EventArgs e) {
    >>
    >> protected Getsid = this.omSSBaseDropDownList.SelectedValue.Trim();

    >
    > A "type" is missing here (between "protected" and "Getsid"). I think it
    > should be:
    > string Getsid = ....
    > or even (if "Getsid" is already declared elsewhere):
    > Getsid = ....
    >
    >>
    >> }
    >>
    >> i get errors like :
    >>
    >> 1.Error 1 } expected
    >> O:\Misys\apps\ifc\webroot\mic\aspx\IfaceWizLabG.aspx.cs 256 71
    >> O:\...\aspx\
    >>
    >> 2. Error 2 Invalid token '=' in class, struct, or interface member
    >> declaration A.aspx.cs 257 25 O:\...\aspx\
    >>
    >> 3.Error 3 Invalid token '(' in class, struct, or interface member
    >> declaration .Baspx.cs 257 76 O:\...\aspx\
    >>
    >> Can any one let me know on how to over come these VS2005 errors?
    >>
    >> Thanks
    >>
    >> Senthil

    >
    >
    SenthilVel, Sep 12, 2006
    #4
  5. SenthilVel

    Hans Kesting Guest

    See also the reply by "Cowboy".

    I'm not sure it's possible to declare a variable that is local to a
    method as "protected". Why do you think you need that functionality
    here?

    either leave out the "protected" to make it a variable, local to the
    method
    or move the declaration up to class-level, where it makes sense to
    define a protected variable.

    Hans Kesting

    > Hi
    >
    > Thanks for the reply ...
    >
    > See i have this question now :
    >
    > The same file i used for this web application using vs2003 : CLR 1.1.
    >
    > now when i used VS2005 and CLR 2.0 , i get these errors when i have codes
    > like below:
    >
    > private void DupFaccodeDelete_Click( object sender, System.EventArgs e ) {
    >
    > protected DeleteCacFacEventReq delReq = new DeleteCacFacEventReq();
    >
    > Error 1 } expected Sample.aspx.cs 253
    >
    > Is this way for declaring a protected member under a event function not
    > allowed in C#2.0 ?
    >
    > IF so , do i need to to change the code which has these usage of protected ??
    >
    > Please let me know on this ..
    >
    > Thanks
    >
    > Senthil
    >
    > "Hans Kesting" <> wrote in message
    > news:...
    >> See inline
    >>
    >>> hi all
    >>>
    >>> i am opening an exiting 1.1 developed ASPX project in VS2005.
    >>>
    >>> i am getting more language editor problems :
    >>>
    >>> for example:
    >>> for the below code :
    >>> /// <summary>
    >>>
    >>> /// Next button on 'next/exit' line pressed
    >>>
    >>> /// </summary>
    >>>
    >>> private void nextButton_Click(object sender, System.EventArgs e) {
    >>>
    >>> protected Getsid = this.omSSBaseDropDownList.SelectedValue.Trim();

    >>
    >> A "type" is missing here (between "protected" and "Getsid"). I think it
    >> should be:
    >> string Getsid = ....
    >> or even (if "Getsid" is already declared elsewhere):
    >> Getsid = ....
    >>
    >>>
    >>> }
    >>>
    >>> i get errors like :
    >>>
    >>> 1.Error 1 } expected
    >>> O:\Misys\apps\ifc\webroot\mic\aspx\IfaceWizLabG.aspx.cs 256 71
    >>> O:\...\aspx\
    >>>
    >>> 2. Error 2 Invalid token '=' in class, struct, or interface member
    >>> declaration A.aspx.cs 257 25 O:\...\aspx\
    >>>
    >>> 3.Error 3 Invalid token '(' in class, struct, or interface member
    >>> declaration .Baspx.cs 257 76 O:\...\aspx\
    >>>
    >>> Can any one let me know on how to over come these VS2005 errors?
    >>>
    >>> Thanks
    >>>
    >>> Senthil

    >>
    >>
    Hans Kesting, Sep 12, 2006
    #5
  6. SenthilVel

    SenthilVel Guest

    hi Hans

    So u mean to say that in 2003 and CLR 1.1 , protected is supported and in
    vs2005 and CLR 2.0 this way of declaring protected is not allowed ...

    Is that true ?

    Thanks
    Senthil



    "Hans Kesting" <> wrote in message
    news:...
    > See also the reply by "Cowboy".
    >
    > I'm not sure it's possible to declare a variable that is local to a method
    > as "protected". Why do you think you need that functionality here?
    >
    > either leave out the "protected" to make it a variable, local to the
    > method
    > or move the declaration up to class-level, where it makes sense to define
    > a protected variable.
    >
    > Hans Kesting
    >
    >> Hi
    >>
    >> Thanks for the reply ...
    >>
    >> See i have this question now :
    >>
    >> The same file i used for this web application using vs2003 : CLR 1.1.
    >>
    >> now when i used VS2005 and CLR 2.0 , i get these errors when i have codes
    >> like below:
    >>
    >> private void DupFaccodeDelete_Click( object sender, System.EventArgs e )
    >> {
    >>
    >> protected DeleteCacFacEventReq delReq = new DeleteCacFacEventReq();
    >>
    >> Error 1 } expected Sample.aspx.cs 253
    >>
    >> Is this way for declaring a protected member under a event function not
    >> allowed in C#2.0 ?
    >>
    >> IF so , do i need to to change the code which has these usage of
    >> protected ??
    >>
    >> Please let me know on this ..
    >>
    >> Thanks
    >>
    >> Senthil
    >>
    >> "Hans Kesting" <> wrote in message
    >> news:...
    >>> See inline
    >>>
    >>>> hi all
    >>>>
    >>>> i am opening an exiting 1.1 developed ASPX project in VS2005.
    >>>>
    >>>> i am getting more language editor problems :
    >>>>
    >>>> for example:
    >>>> for the below code :
    >>>> /// <summary>
    >>>>
    >>>> /// Next button on 'next/exit' line pressed
    >>>>
    >>>> /// </summary>
    >>>>
    >>>> private void nextButton_Click(object sender, System.EventArgs e) {
    >>>>
    >>>> protected Getsid = this.omSSBaseDropDownList.SelectedValue.Trim();
    >>>
    >>> A "type" is missing here (between "protected" and "Getsid"). I think it
    >>> should be:
    >>> string Getsid = ....
    >>> or even (if "Getsid" is already declared elsewhere):
    >>> Getsid = ....
    >>>
    >>>>
    >>>> }
    >>>>
    >>>> i get errors like :
    >>>>
    >>>> 1.Error 1 } expected
    >>>> O:\Misys\apps\ifc\webroot\mic\aspx\IfaceWizLabG.aspx.cs 256 71
    >>>> O:\...\aspx\
    >>>>
    >>>> 2. Error 2 Invalid token '=' in class, struct, or interface member
    >>>> declaration A.aspx.cs 257 25 O:\...\aspx\
    >>>>
    >>>> 3.Error 3 Invalid token '(' in class, struct, or interface member
    >>>> declaration .Baspx.cs 257 76 O:\...\aspx\
    >>>>
    >>>> Can any one let me know on how to over come these VS2005 errors?
    >>>>
    >>>> Thanks
    >>>>
    >>>> Senthil
    >>>
    >>>

    >
    >
    SenthilVel, Sep 12, 2006
    #6
  7. SenthilVel

    Hans Kesting Guest

    > hi Hans
    >
    > So u mean to say that in 2003 and CLR 1.1 , protected is supported and in
    > vs2005 and CLR 2.0 this way of declaring protected is not allowed ...
    >
    > Is that true ?
    >
    > Thanks
    > Senthil
    >


    My *guess* is that the behaviour of VS2003 was wrong and has been
    corrected in VS2005.

    What are you trying to do? Why do you need "protected" here?

    Hans Kesting

    > "Hans Kesting" <> wrote in message
    > news:...
    >> See also the reply by "Cowboy".
    >>
    >> I'm not sure it's possible to declare a variable that is local to a method
    >> as "protected". Why do you think you need that functionality here?
    >>
    >> either leave out the "protected" to make it a variable, local to the method
    >> or move the declaration up to class-level, where it makes sense to define a
    >> protected variable.
    >>
    >> Hans Kesting
    >>
    >>> Hi
    >>>
    >>> Thanks for the reply ...
    >>>
    >>> See i have this question now :
    >>>
    >>> The same file i used for this web application using vs2003 : CLR 1.1.
    >>>
    >>> now when i used VS2005 and CLR 2.0 , i get these errors when i have codes
    >>> like below:
    >>>
    >>> private void DupFaccodeDelete_Click( object sender, System.EventArgs e ) {
    >>>
    >>> protected DeleteCacFacEventReq delReq = new DeleteCacFacEventReq();
    >>>
    >>> Error 1 } expected Sample.aspx.cs 253
    >>>
    >>> Is this way for declaring a protected member under a event function not
    >>> allowed in C#2.0 ?
    >>>
    >>> IF so , do i need to to change the code which has these usage of protected
    >>> ??
    >>>
    >>> Please let me know on this ..
    >>>
    >>> Thanks
    >>>
    >>> Senthil
    >>>
    >>> "Hans Kesting" <> wrote in message
    >>> news:...
    >>>> See inline
    >>>>
    >>>>>
    >>>>
    >>>> A "type" is missing here (between "protected" and "Getsid"). I think it
    >>>> should be:
    >>>> string Getsid = ....
    >>>> or even (if "Getsid" is already declared elsewhere):
    >>>> Getsid = ....
    >>>>
    >>>>>
    >>>>

    >>
    >>
    Hans Kesting, Sep 12, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dbuchanan
    Replies:
    9
    Views:
    4,140
    Jim Wooley
    Feb 8, 2006
  2. Mark Goldin

    Errors, errors, errors

    Mark Goldin, Jan 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    922
    Mark Goldin
    Jan 17, 2004
  3. Andrew Edwards

    Type name expected: Errors

    Andrew Edwards, Jul 27, 2003, in forum: C++
    Replies:
    1
    Views:
    759
    Andrew Edwards
    Jul 27, 2003
  4. Replies:
    1
    Views:
    337
    David
    Apr 16, 2007
  5. AAaron123
    Replies:
    0
    Views:
    539
    AAaron123
    Mar 12, 2009
Loading...

Share This Page