Visual Basic 2005 - designer.vb page problem

Discussion in 'ASP .Net' started by Goran Djuranovic, Aug 30, 2007.

  1. Hi all,
    I am experiencing a strange thing happening with a "designer.vb" page. Controls I manually declare in this page are automatically deleted after I drop another control on a ".aspx" page.
    - Why is this happening?
    - Can I disable automatic declaration and have everything be declared manually?
    - Any other options to fix this?

    Thanks in advance.
    Goran Djuranovic
     
    Goran Djuranovic, Aug 30, 2007
    #1
    1. Advertising

  2. Hi Goran,

    Based on your description, I think you're using the VS 2005 SP1's "Web
    Application Project" model for your ASP.NET application development,
    correct?

    If so, the behavior you encountered(manually declcared control member will
    be removed after you add new controls onto webform) is the expected
    behavior. This is because the VS IDE(webform designer) will always
    synchronize the webform aspx tempalte with the codebehind(designer.vb or
    designer.cs) whenever there is any change in the aspx template. When
    performing the synchronizing, it will regenerate the page partial classes'
    member control variables so as to match the aspx template. Therefore, if
    you have any member variable that haven't an actual control (with the
    identical ID to the member field name) in aspx , that member variable will
    be removed. Does this explain your problem?

    Also, designer.vb/designer.cs file is not designed to be edited by user
    directly, if you have some custom properties/fields what to add on the
    page, you should utilize the non-designer codebehind (pagename.vb file),
    this file won't be modified by the IDE automatically. Is there any
    particular concern that you can not use this?

    If you have any further questions, please feel free to post here.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    ==================================================

    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.



    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.

    ==================================================


    This posting is provided "AS IS" with no warranties, and confers no rights.





    --------------------
    >From: "Goran Djuranovic" <>
    >Subject: Visual Basic 2005 - designer.vb page problem


    >
    >Hi all,
    >I am experiencing a strange thing happening with a "designer.vb" page.

    Controls I manually declare in this page are automatically deleted after I
    drop another control on a ".aspx" page.
    >- Why is this happening?
    >- Can I disable automatic declaration and have everything be declared

    manually?
    >- Any other options to fix this?
    >Thanks in advance.
    >Goran Djuranovic
    >
     
    Steven Cheng[MSFT], Aug 31, 2007
    #2
    1. Advertising

  3. Hi Steven,
    I understand what you are saying, and I kind of suspected that. But, I am
    still not sure how the designer "knows" what controls I added manually (they
    have the exact same code format as automatically added controls).

    Here is what really happened. My project is a converted project (from 2003),
    so all the controls used to be declared in code-behind. After conversion,
    most of them got moved to designer.vb, but not all?! Now, when I moved the
    rest of them to the designer.vb page, they got removed the next time I
    changed some thing in .aspx page. When I say removed I mean totally missing
    from both code-behind and designer.vb. So, now I have to have my
    declarations in two different pages, which really sucks.

    My questions:
    - Is there a way to disable synchronization between the files (.aspx &
    designer.vb)?
    - How does the designer know which controls were automatically vs. manually
    added (from some file or...)?
    - Is there a way to revert to use only code-behind page?

    Thanks a lot.
    Goran

    "Steven Cheng[MSFT]" <> wrote in message
    news:...
    > Hi Goran,
    >
    > Based on your description, I think you're using the VS 2005 SP1's "Web
    > Application Project" model for your ASP.NET application development,
    > correct?
    >
    > If so, the behavior you encountered(manually declcared control member will
    > be removed after you add new controls onto webform) is the expected
    > behavior. This is because the VS IDE(webform designer) will always
    > synchronize the webform aspx tempalte with the codebehind(designer.vb or
    > designer.cs) whenever there is any change in the aspx template. When
    > performing the synchronizing, it will regenerate the page partial classes'
    > member control variables so as to match the aspx template. Therefore, if
    > you have any member variable that haven't an actual control (with the
    > identical ID to the member field name) in aspx , that member variable will
    > be removed. Does this explain your problem?
    >
    > Also, designer.vb/designer.cs file is not designed to be edited by user
    > directly, if you have some custom properties/fields what to add on the
    > page, you should utilize the non-designer codebehind (pagename.vb file),
    > this file won't be modified by the IDE automatically. Is there any
    > particular concern that you can not use this?
    >
    > If you have any further questions, please feel free to post here.
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    >
    > ==================================================
    >
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    >
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >
    > ==================================================
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
    >
    >
    >
    >
    > --------------------
    >>From: "Goran Djuranovic" <>
    >>Subject: Visual Basic 2005 - designer.vb page problem

    >
    >>
    >>Hi all,
    >>I am experiencing a strange thing happening with a "designer.vb" page.

    > Controls I manually declare in this page are automatically deleted after I
    > drop another control on a ".aspx" page.
    >>- Why is this happening?
    >>- Can I disable automatic declaration and have everything be declared

    > manually?
    >>- Any other options to fix this?
    >>Thanks in advance.
    >>Goran Djuranovic
    >>

    >
     
    Goran Djuranovic, Aug 31, 2007
    #3
  4. Thanks for your reply Goran,

    For the further questions you mentioned, I'm afraid this synchronize is
    necessary in the ASP.NET 2.0 web application project since it help ensure
    the ASP.NET 2.0 page be correct (can be compiled correctly at runtime)
    because ASP.NET 2.0 use a dynamic compilation model. For the VS 2005 IDE,
    I haven't got the exact code logic of the webform designer in vs 2005 and
    how to synchronize the html source and codebehind(designer.xx), but I think
    it should look for all the toplevel controls in aspx template(which need a
    member variable reference in page class) and generate one in the
    designer.vb/cs file. Also, so far there is no project model that can work
    exactly as VS 2003/ASP.NET 1.1 one in Visual Studio 2005, this is becaues
    ASP.NET 2.0 application compilation model has changed and VS 2003/ASP.NET
    1.1 one is not adoptable here.

    For the problem here, I think there might be some certain control or the
    structure of the aspx page template which make the IDE fail to generate all
    the control member references. Is the page suffering the problem contains
    only standard ASP.NET controls or can you repro the problem through a very
    simple page with only standard controls? If so, you can provide me such a
    page so that I can also perform some local tests.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.


    --------------------
    >From: "Goran Djuranovic" <>
    >References: <>

    <>
    >Subject: Re: Visual Basic 2005 - designer.vb page problem
    >Date: Fri, 31 Aug 2007 15:28:17 -0400


    >
    >Hi Steven,
    >I understand what you are saying, and I kind of suspected that. But, I am
    >still not sure how the designer "knows" what controls I added manually

    (they
    >have the exact same code format as automatically added controls).
    >
    >Here is what really happened. My project is a converted project (from

    2003),
    >so all the controls used to be declared in code-behind. After conversion,
    >most of them got moved to designer.vb, but not all?! Now, when I moved the
    >rest of them to the designer.vb page, they got removed the next time I
    >changed some thing in .aspx page. When I say removed I mean totally

    missing
    >from both code-behind and designer.vb. So, now I have to have my
    >declarations in two different pages, which really sucks.
    >
    >My questions:
    >- Is there a way to disable synchronization between the files (.aspx &
    >designer.vb)?
    >- How does the designer know which controls were automatically vs.

    manually
    >added (from some file or...)?
    >- Is there a way to revert to use only code-behind page?
    >
    >Thanks a lot.
    >Goran
    >
    >"Steven Cheng[MSFT]" <> wrote in message
    >news:...
    >> Hi Goran,
    >>
    >> Based on your description, I think you're using the VS 2005 SP1's "Web
    >> Application Project" model for your ASP.NET application development,
    >> correct?
    >>
    >> If so, the behavior you encountered(manually declcared control member

    will
    >> be removed after you add new controls onto webform) is the expected
    >> behavior. This is because the VS IDE(webform designer) will always
    >> synchronize the webform aspx tempalte with the codebehind(designer.vb or
    >> designer.cs) whenever there is any change in the aspx template. When
    >> performing the synchronizing, it will regenerate the page partial

    classes'
    >> member control variables so as to match the aspx template. Therefore, if
    >> you have any member variable that haven't an actual control (with the
    >> identical ID to the member field name) in aspx , that member variable

    will
    >> be removed. Does this explain your problem?
    >>
    >> Also, designer.vb/designer.cs file is not designed to be edited by user
    >> directly, if you have some custom properties/fields what to add on the
    >> page, you should utilize the non-designer codebehind (pagename.vb file),
    >> this file won't be modified by the IDE automatically. Is there any
    >> particular concern that you can not use this?
    >>
    >> If you have any further questions, please feel free to post here.
    >>
    >> Sincerely,
    >>
    >> Steven Cheng
    >>
    >> Microsoft MSDN Online Support Lead
    >>
    >>
    >>
    >> ==================================================
    >>
    >> Get notification to my posts through email? Please refer to
    >>

    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    >> ications.
    >>
    >>
    >>
    >> Note: The MSDN Managed Newsgroup support offering is for non-urgent

    issues
    >> where an initial response from the community or a Microsoft Support
    >> Engineer within 1 business day is acceptable. Please note that each

    follow
    >> up response may take approximately 2 business days as the support
    >> professional working with you may need further investigation to reach the
    >> most efficient resolution. The offering is not appropriate for situations
    >> that require urgent, real-time or phone-based interactions or complex
    >> project analysis and dump analysis issues. Issues of this nature are best
    >> handled working with a dedicated Microsoft Support Engineer by contacting
    >> Microsoft Customer Support Services (CSS) at
    >> http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >>
    >> ==================================================
    >>
    >>
    >> This posting is provided "AS IS" with no warranties, and confers no
    >> rights.
    >>
    >>
    >>
    >>
    >>
    >> --------------------
    >>>From: "Goran Djuranovic" <>
    >>>Subject: Visual Basic 2005 - designer.vb page problem

    >>
    >>>
    >>>Hi all,
    >>>I am experiencing a strange thing happening with a "designer.vb" page.

    >> Controls I manually declare in this page are automatically deleted after

    I
    >> drop another control on a ".aspx" page.
    >>>- Why is this happening?
    >>>- Can I disable automatic declaration and have everything be declared

    >> manually?
    >>>- Any other options to fix this?
    >>>Thanks in advance.
    >>>Goran Djuranovic
    >>>

    >>

    >
    >
    >
     
    Steven Cheng[MSFT], Sep 3, 2007
    #4
  5. Hi Goran,

    Any further question on this? If so, please don't hesitate to post here.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead

    This posting is provided "AS IS" with no warranties, and confers no rights.


    --------------------

    >
    >Thanks for your reply Goran,
    >
    >For the further questions you mentioned, I'm afraid this synchronize is
    >necessary in the ASP.NET 2.0 web application project since it help ensure
    >the ASP.NET 2.0 page be correct (can be compiled correctly at runtime)
    >because ASP.NET 2.0 use a dynamic compilation model. For the VS 2005 IDE,
    >I haven't got the exact code logic of the webform designer in vs 2005 and
    >how to synchronize the html source and codebehind(designer.xx), but I

    think
    >it should look for all the toplevel controls in aspx template(which need a
    >member variable reference in page class) and generate one in the
    >designer.vb/cs file. Also, so far there is no project model that can

    work
    >exactly as VS 2003/ASP.NET 1.1 one in Visual Studio 2005, this is becaues
    >ASP.NET 2.0 application compilation model has changed and VS 2003/ASP.NET
    >1.1 one is not adoptable here.
    >
    >For the problem here, I think there might be some certain control or the
    >structure of the aspx page template which make the IDE fail to generate

    all
    >the control member references. Is the page suffering the problem contains
    >only standard ASP.NET controls or can you repro the problem through a very
    >simple page with only standard controls? If so, you can provide me such a
    >page so that I can also perform some local tests.
    >
    >Sincerely,
    >
    >Steven Cheng
    >
    >Microsoft MSDN Online Support Lead
    >
    >
    >This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
    >--------------------
    >>From: "Goran Djuranovic" <>
    >>References: <>

    ><>
    >>Subject: Re: Visual Basic 2005 - designer.vb page problem
    >>Date: Fri, 31 Aug 2007 15:28:17 -0400

    >
    >>
    >>Hi Steven,
    >>I understand what you are saying, and I kind of suspected that. But, I am
    >>still not sure how the designer "knows" what controls I added manually

    >(they
    >>have the exact same code format as automatically added controls).
    >>
    >>Here is what really happened. My project is a converted project (from

    >2003),
    >>so all the controls used to be declared in code-behind. After conversion,
    >>most of them got moved to designer.vb, but not all?! Now, when I moved

    the
    >>rest of them to the designer.vb page, they got removed the next time I
    >>changed some thing in .aspx page. When I say removed I mean totally

    >missing
    >>from both code-behind and designer.vb. So, now I have to have my
    >>declarations in two different pages, which really sucks.
    >>
    >>My questions:
    >>- Is there a way to disable synchronization between the files (.aspx &
    >>designer.vb)?
    >>- How does the designer know which controls were automatically vs.

    >manually
    >>added (from some file or...)?
    >>- Is there a way to revert to use only code-behind page?
    >>
    >>Thanks a lot.
    >>Goran
    >>
    >>"Steven Cheng[MSFT]" <> wrote in message
    >>news:...
    >>> Hi Goran,
    >>>
    >>> Based on your description, I think you're using the VS 2005 SP1's "Web
    >>> Application Project" model for your ASP.NET application development,
    >>> correct?
    >>>
    >>> If so, the behavior you encountered(manually declcared control member

    >will
    >>> be removed after you add new controls onto webform) is the expected
    >>> behavior. This is because the VS IDE(webform designer) will always
    >>> synchronize the webform aspx tempalte with the codebehind(designer.vb or
    >>> designer.cs) whenever there is any change in the aspx template. When
    >>> performing the synchronizing, it will regenerate the page partial

    >classes'
    >>> member control variables so as to match the aspx template. Therefore,

    if
    >>> you have any member variable that haven't an actual control (with the
    >>> identical ID to the member field name) in aspx , that member variable

    >will
    >>> be removed. Does this explain your problem?
    >>>
    >>> Also, designer.vb/designer.cs file is not designed to be edited by user
    >>> directly, if you have some custom properties/fields what to add on the
    >>> page, you should utilize the non-designer codebehind (pagename.vb

    file),
    >>> this file won't be modified by the IDE automatically. Is there any
    >>> particular concern that you can not use this?
    >>>
    >>> If you have any further questions, please feel free to post here.
    >>>
    >>> Sincerely,
    >>>
    >>> Steven Cheng
    >>>
    >>> Microsoft MSDN Online Support Lead
    >>>
    >>>
    >>>
    >>> ==================================================
    >>>
    >>> Get notification to my posts through email? Please refer to
    >>>

    >http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#noti

    f
    >>> ications.
    >>>
    >>>
    >>>
    >>> Note: The MSDN Managed Newsgroup support offering is for non-urgent

    >issues
    >>> where an initial response from the community or a Microsoft Support
    >>> Engineer within 1 business day is acceptable. Please note that each

    >follow
    >>> up response may take approximately 2 business days as the support
    >>> professional working with you may need further investigation to reach

    the
    >>> most efficient resolution. The offering is not appropriate for

    situations
    >>> that require urgent, real-time or phone-based interactions or complex
    >>> project analysis and dump analysis issues. Issues of this nature are

    best
    >>> handled working with a dedicated Microsoft Support Engineer by

    contacting
    >>> Microsoft Customer Support Services (CSS) at
    >>> http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >>>
    >>> ==================================================
    >>>
    >>>
    >>> This posting is provided "AS IS" with no warranties, and confers no
    >>> rights.
    >>>
    >>>
    >>>
    >>>
    >>>
    >>> --------------------
    >>>>From: "Goran Djuranovic" <>
    >>>>Subject: Visual Basic 2005 - designer.vb page problem
    >>>
    >>>>
    >>>>Hi all,
    >>>>I am experiencing a strange thing happening with a "designer.vb" page.
    >>> Controls I manually declare in this page are automatically deleted

    after
    >I
    >>> drop another control on a ".aspx" page.
    >>>>- Why is this happening?
    >>>>- Can I disable automatic declaration and have everything be declared
    >>> manually?
    >>>>- Any other options to fix this?
    >>>>Thanks in advance.
    >>>>Goran Djuranovic
    >>>>
    >>>

    >>
    >>
    >>

    >
    >
     
    Steven Cheng[MSFT], Sep 5, 2007
    #5
  6. Hi Steven,
    In order to eliminate this problem, I decided to move all the declarations
    from .designer.vb page to .vb page. This way the designer doesn't perform
    any actions on the existing controls, and any new control will be
    automatically put into the .designer.vb page. So, it is basically like
    starting from scratch with the .designer.vb page. So far it works good.

    Thanks for your help.
    Goran

    "Steven Cheng[MSFT]" <> wrote in message
    news:...
    > Hi Goran,
    >
    > Any further question on this? If so, please don't hesitate to post here.
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
    >
    > --------------------
    >
    >>
    >>Thanks for your reply Goran,
    >>
    >>For the further questions you mentioned, I'm afraid this synchronize is
    >>necessary in the ASP.NET 2.0 web application project since it help ensure
    >>the ASP.NET 2.0 page be correct (can be compiled correctly at runtime)
    >>because ASP.NET 2.0 use a dynamic compilation model. For the VS 2005 IDE,
    >>I haven't got the exact code logic of the webform designer in vs 2005 and
    >>how to synchronize the html source and codebehind(designer.xx), but I

    > think
    >>it should look for all the toplevel controls in aspx template(which need a
    >>member variable reference in page class) and generate one in the
    >>designer.vb/cs file. Also, so far there is no project model that can

    > work
    >>exactly as VS 2003/ASP.NET 1.1 one in Visual Studio 2005, this is becaues
    >>ASP.NET 2.0 application compilation model has changed and VS 2003/ASP.NET
    >>1.1 one is not adoptable here.
    >>
    >>For the problem here, I think there might be some certain control or the
    >>structure of the aspx page template which make the IDE fail to generate

    > all
    >>the control member references. Is the page suffering the problem contains
    >>only standard ASP.NET controls or can you repro the problem through a very
    >>simple page with only standard controls? If so, you can provide me such a
    >>page so that I can also perform some local tests.
    >>
    >>Sincerely,
    >>
    >>Steven Cheng
    >>
    >>Microsoft MSDN Online Support Lead
    >>
    >>
    >>This posting is provided "AS IS" with no warranties, and confers no
    >>rights.
    >>
    >>
    >>--------------------
    >>>From: "Goran Djuranovic" <>
    >>>References: <>

    >><>
    >>>Subject: Re: Visual Basic 2005 - designer.vb page problem
    >>>Date: Fri, 31 Aug 2007 15:28:17 -0400

    >>
    >>>
    >>>Hi Steven,
    >>>I understand what you are saying, and I kind of suspected that. But, I am
    >>>still not sure how the designer "knows" what controls I added manually

    >>(they
    >>>have the exact same code format as automatically added controls).
    >>>
    >>>Here is what really happened. My project is a converted project (from

    >>2003),
    >>>so all the controls used to be declared in code-behind. After conversion,
    >>>most of them got moved to designer.vb, but not all?! Now, when I moved

    > the
    >>>rest of them to the designer.vb page, they got removed the next time I
    >>>changed some thing in .aspx page. When I say removed I mean totally

    >>missing
    >>>from both code-behind and designer.vb. So, now I have to have my
    >>>declarations in two different pages, which really sucks.
    >>>
    >>>My questions:
    >>>- Is there a way to disable synchronization between the files (.aspx &
    >>>designer.vb)?
    >>>- How does the designer know which controls were automatically vs.

    >>manually
    >>>added (from some file or...)?
    >>>- Is there a way to revert to use only code-behind page?
    >>>
    >>>Thanks a lot.
    >>>Goran
    >>>
    >>>"Steven Cheng[MSFT]" <> wrote in message
    >>>news:...
    >>>> Hi Goran,
    >>>>
    >>>> Based on your description, I think you're using the VS 2005 SP1's "Web
    >>>> Application Project" model for your ASP.NET application development,
    >>>> correct?
    >>>>
    >>>> If so, the behavior you encountered(manually declcared control member

    >>will
    >>>> be removed after you add new controls onto webform) is the expected
    >>>> behavior. This is because the VS IDE(webform designer) will always
    >>>> synchronize the webform aspx tempalte with the codebehind(designer.vb
    >>>> or
    >>>> designer.cs) whenever there is any change in the aspx template. When
    >>>> performing the synchronizing, it will regenerate the page partial

    >>classes'
    >>>> member control variables so as to match the aspx template. Therefore,

    > if
    >>>> you have any member variable that haven't an actual control (with the
    >>>> identical ID to the member field name) in aspx , that member variable

    >>will
    >>>> be removed. Does this explain your problem?
    >>>>
    >>>> Also, designer.vb/designer.cs file is not designed to be edited by user
    >>>> directly, if you have some custom properties/fields what to add on the
    >>>> page, you should utilize the non-designer codebehind (pagename.vb

    > file),
    >>>> this file won't be modified by the IDE automatically. Is there any
    >>>> particular concern that you can not use this?
    >>>>
    >>>> If you have any further questions, please feel free to post here.
    >>>>
    >>>> Sincerely,
    >>>>
    >>>> Steven Cheng
    >>>>
    >>>> Microsoft MSDN Online Support Lead
    >>>>
    >>>>
    >>>>
    >>>> ==================================================
    >>>>
    >>>> Get notification to my posts through email? Please refer to
    >>>>

    >>http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#noti

    > f
    >>>> ications.
    >>>>
    >>>>
    >>>>
    >>>> Note: The MSDN Managed Newsgroup support offering is for non-urgent

    >>issues
    >>>> where an initial response from the community or a Microsoft Support
    >>>> Engineer within 1 business day is acceptable. Please note that each

    >>follow
    >>>> up response may take approximately 2 business days as the support
    >>>> professional working with you may need further investigation to reach

    > the
    >>>> most efficient resolution. The offering is not appropriate for

    > situations
    >>>> that require urgent, real-time or phone-based interactions or complex
    >>>> project analysis and dump analysis issues. Issues of this nature are

    > best
    >>>> handled working with a dedicated Microsoft Support Engineer by

    > contacting
    >>>> Microsoft Customer Support Services (CSS) at
    >>>> http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >>>>
    >>>> ==================================================
    >>>>
    >>>>
    >>>> This posting is provided "AS IS" with no warranties, and confers no
    >>>> rights.
    >>>>
    >>>>
    >>>>
    >>>>
    >>>>
    >>>> --------------------
    >>>>>From: "Goran Djuranovic" <>
    >>>>>Subject: Visual Basic 2005 - designer.vb page problem
    >>>>
    >>>>>
    >>>>>Hi all,
    >>>>>I am experiencing a strange thing happening with a "designer.vb" page.
    >>>> Controls I manually declare in this page are automatically deleted

    > after
    >>I
    >>>> drop another control on a ".aspx" page.
    >>>>>- Why is this happening?
    >>>>>- Can I disable automatic declaration and have everything be declared
    >>>> manually?
    >>>>>- Any other options to fix this?
    >>>>>Thanks in advance.
    >>>>>Goran Djuranovic
    >>>>>
    >>>>
    >>>
    >>>
    >>>

    >>
    >>

    >
     
    Goran Djuranovic, Sep 7, 2007
    #6
  7. Thanks for your followup Goran,

    Glad that you've found a way to make it working now. If you need any
    further help later, welcome to post here.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.


    --------------------
    >Reply-To: "Goran Djuranovic" <>
    >From: "Goran Djuranovic" <>
    >References: <>

    <> <O#LlWUA7HHA.4436
    >
    >Hi Steven,
    >In order to eliminate this problem, I decided to move all the declarations
    >from .designer.vb page to .vb page. This way the designer doesn't perform
    >any actions on the existing controls, and any new control will be
    >automatically put into the .designer.vb page. So, it is basically like
    >starting from scratch with the .designer.vb page. So far it works good.
    >
    >Thanks for your help.
    >Goran
    >
    >"Steven Cheng[MSFT]" <> wrote in message
    >news:...
    >> Hi Goran,
    >>
    >> Any further question on this? If so, please don't hesitate to post here.
    >>
    >> Sincerely,
    >>
    >> Steven Cheng
    >>
    >> Microsoft MSDN Online Support Lead
    >>
    >> This posting is provided "AS IS" with no warranties, and confers no
    >> rights.
    >>
    >>
    >> --------------------
    >>
    >>>
    >>>Thanks for your reply Goran,
    >>>
    >>>For the further questions you mentioned, I'm afraid this synchronize is
    >>>necessary in the ASP.NET 2.0 web application project since it help ensure
    >>>the ASP.NET 2.0 page be correct (can be compiled correctly at runtime)
    >>>because ASP.NET 2.0 use a dynamic compilation model. For the VS 2005

    IDE,
    >>>I haven't got the exact code logic of the webform designer in vs 2005 and
    >>>how to synchronize the html source and codebehind(designer.xx), but I

    >> think
    >>>it should look for all the toplevel controls in aspx template(which need

    a
    >>>member variable reference in page class) and generate one in the
    >>>designer.vb/cs file. Also, so far there is no project model that can

    >> work
    >>>exactly as VS 2003/ASP.NET 1.1 one in Visual Studio 2005, this is becaues
    >>>ASP.NET 2.0 application compilation model has changed and VS 2003/ASP.NET
    >>>1.1 one is not adoptable here.
    >>>
    >>>For the problem here, I think there might be some certain control or the
    >>>structure of the aspx page template which make the IDE fail to generate

    >> all
    >>>the control member references. Is the page suffering the problem contains
    >>>only standard ASP.NET controls or can you repro the problem through a

    very
    >>>simple page with only standard controls? If so, you can provide me such a
    >>>page so that I can also perform some local tests.
    >>>
    >>>Sincerely,
    >>>
    >>>Steven Cheng
    >>>
    >>>Microsoft MSDN Online Support Lead
    >>>
    >>>
    >>>This posting is provided "AS IS" with no warranties, and confers no
    >>>rights.
    >>>
    >>>
    >>>--------------------
    >>>>From: "Goran Djuranovic" <>
    >>>>References: <>
    >>><>
    >>>>Subject: Re: Visual Basic 2005 - designer.vb page problem
    >>>>Date: Fri, 31 Aug 2007 15:28:17 -0400
    >>>
    >>>>
    >>>>Hi Steven,
    >>>>I understand what you are saying, and I kind of suspected that. But, I

    am
    >>>>still not sure how the designer "knows" what controls I added manually
    >>>(they
    >>>>have the exact same code format as automatically added controls).
    >>>>
    >>>>Here is what really happened. My project is a converted project (from
    >>>2003),
    >>>>so all the controls used to be declared in code-behind. After

    conversion,
    >>>>most of them got moved to designer.vb, but not all?! Now, when I moved

    >> the
    >>>>rest of them to the designer.vb page, they got removed the next time I
    >>>>changed some thing in .aspx page. When I say removed I mean totally
    >>>missing
    >>>>from both code-behind and designer.vb. So, now I have to have my
    >>>>declarations in two different pages, which really sucks.
    >>>>
    >>>>My questions:
    >>>>- Is there a way to disable synchronization between the files (.aspx &
    >>>>designer.vb)?
    >>>>- How does the designer know which controls were automatically vs.
    >>>manually
    >>>>added (from some file or...)?
    >>>>- Is there a way to revert to use only code-behind page?
    >>>>
    >>>>Thanks a lot.
    >>>>Goran
    >>>>
    >>>>"Steven Cheng[MSFT]" <> wrote in message
    >>>>news:...
    >>>>> Hi Goran,
    >>>>>
    >>>>> Based on your description, I think you're using the VS 2005 SP1's "Web
    >>>>> Application Project" model for your ASP.NET application development,
    >>>>> correct?
    >>>>>
    >>>>> If so, the behavior you encountered(manually declcared control member
    >>>will
    >>>>> be removed after you add new controls onto webform) is the expected
    >>>>> behavior. This is because the VS IDE(webform designer) will always
    >>>>> synchronize the webform aspx tempalte with the codebehind(designer.vb
    >>>>> or
    >>>>> designer.cs) whenever there is any change in the aspx template. When
    >>>>> performing the synchronizing, it will regenerate the page partial
    >>>classes'
    >>>>> member control variables so as to match the aspx template. Therefore,

    >> if
    >>>>> you have any member variable that haven't an actual control (with the
    >>>>> identical ID to the member field name) in aspx , that member variable
    >>>will
    >>>>> be removed. Does this explain your problem?
    >>>>>
    >>>>> Also, designer.vb/designer.cs file is not designed to be edited by

    user
    >>>>> directly, if you have some custom properties/fields what to add on the
    >>>>> page, you should utilize the non-designer codebehind (pagename.vb

    >> file),
    >>>>> this file won't be modified by the IDE automatically. Is there any
    >>>>> particular concern that you can not use this?
    >>>>>
    >>>>> If you have any further questions, please feel free to post here.
    >>>>>
    >>>>> Sincerely,
    >>>>>
    >>>>> Steven Cheng
    >>>>>
    >>>>> Microsoft MSDN Online Support Lead
    >>>>>
    >>>>>
    >>>>>
    >>>>> ==================================================
    >>>>>
    >>>>> Get notification to my posts through email? Please refer to
    >>>>>
    >>>http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#no

    ti
    >> f
    >>>>> ications.
    >>>>>
    >>>>>
    >>>>>
    >>>>> Note: The MSDN Managed Newsgroup support offering is for non-urgent
    >>>issues
    >>>>> where an initial response from the community or a Microsoft Support
    >>>>> Engineer within 1 business day is acceptable. Please note that each
    >>>follow
    >>>>> up response may take approximately 2 business days as the support
    >>>>> professional working with you may need further investigation to reach

    >> the
    >>>>> most efficient resolution. The offering is not appropriate for

    >> situations
    >>>>> that require urgent, real-time or phone-based interactions or complex
    >>>>> project analysis and dump analysis issues. Issues of this nature are

    >> best
    >>>>> handled working with a dedicated Microsoft Support Engineer by

    >> contacting
    >>>>> Microsoft Customer Support Services (CSS) at
    >>>>> http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >>>>>
    >>>>> ==================================================
    >>>>>
    >>>>>
    >>>>> This posting is provided "AS IS" with no warranties, and confers no
    >>>>> rights.
    >>>>>
    >>>>>
    >>>>>
    >>>>>
    >>>>>
    >>>>> --------------------
    >>>>>>From: "Goran Djuranovic" <>
    >>>>>>Subject: Visual Basic 2005 - designer.vb page problem
    >>>>>
    >>>>>>
    >>>>>>Hi all,
    >>>>>>I am experiencing a strange thing happening with a "designer.vb" page.
    >>>>> Controls I manually declare in this page are automatically deleted

    >> after
    >>>I
    >>>>> drop another control on a ".aspx" page.
    >>>>>>- Why is this happening?
    >>>>>>- Can I disable automatic declaration and have everything be declared
    >>>>> manually?
    >>>>>>- Any other options to fix this?
    >>>>>>Thanks in advance.
    >>>>>>Goran Djuranovic
    >>>>>>
    >>>>>
    >>>>
    >>>>
    >>>>
    >>>
    >>>

    >>

    >
    >
    >
     
    Steven Cheng[MSFT], Sep 11, 2007
    #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. Stewart
    Replies:
    1
    Views:
    524
    Ken Cox [Microsoft MVP]
    Feb 24, 2006
  2. Ben Fidge
    Replies:
    0
    Views:
    1,823
    Ben Fidge
    Feb 26, 2006
  3. hunkgym
    Replies:
    1
    Views:
    1,988
    =?Utf-8?B?TGVvbiBNYXluZQ==?=
    Oct 30, 2006
  4. Goofy
    Replies:
    2
    Views:
    321
  5. Ganesh
    Replies:
    0
    Views:
    375
    Ganesh
    Mar 11, 2007
Loading...

Share This Page