Results 1 to 4 of 4

Thread: [RESOLVED] VS 2012 Porting code from Framework 2.0 to Framework 4.5

  1. #1

    Thread Starter
    Hyperactive Member Greyskull's Avatar
    Join Date
    Dec 2003
    Location
    somewhere in England
    Posts
    382

    Resolved [RESOLVED] VS 2012 Porting code from Framework 2.0 to Framework 4.5

    Hello all,

    I am having problem porting some of my old codes to the new framework and the new visual studio, like the Profile.<Field> info:

    Here is a snippet of my old Web.config:

    Code:
    <profile>
    	<properties>
    		<add name="Title" />
    		<add name="Forename" />
    		<add name="Surname" />
    		<add name="Initials" />
    	</properties>
    </profile>
    I have ported it exactly the same way in the new VS and but it can't seem to recognise the following code behind my asp page:

    Code:
    txtInitials.Text = Profile.Initials;
    Any ideas what I'm doing wrong / what I have missed in the new frameworks?

    Thanks,

    Greyskull
    Please go to the Thread Tools menu and click Mark Thread Resolved when your post is answered
    If someone helped you today then please consider rating their post.

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: VS 2012 Porting code from Framework 2.0 to Framework 4.5

    I haven't used 4.5 but it would be stupid if they have removed it without warning.
    Have a look here:
    http://odetocode.com/articles/440.aspx
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: VS 2012 Porting code from Framework 2.0 to Framework 4.5

    How is PROFILE declared - do you have some IMPORTS statements up top of this code? What is PROFILE part of?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4

    Thread Starter
    Hyperactive Member Greyskull's Avatar
    Join Date
    Dec 2003
    Location
    somewhere in England
    Posts
    382

    Re: VS 2012 Porting code from Framework 2.0 to Framework 4.5

    Many thanks for the replies. I have found it now.

    Seems strange I can't access the "Profile.Initials" in the codefile (.aspx.cs) but instead can access it in the web form itself (.aspx).

    Code:
    <script runat="server">
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
    	if (Page.IsValid)
    	{
    		Profile.Initals = txtInitals.Text;
    	}
    }
    </script>
    Weird way of doing things but it works so it will do for now.
    Please go to the Thread Tools menu and click Mark Thread Resolved when your post is answered
    If someone helped you today then please consider rating their post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width