VS.NET removes "Runat=Server" without asking???

Discussion in 'ASP .Net' started by Ronald Colijn, Nov 17, 2003.

  1. HELP,

    This is driving me crazy!

    I have made a asp.net page and at the top I have this:

    <HTML>
    <HEAD>
    <title id="PageTitle" runat="server">A Title</title>
    <meta id="MetaDescription" name="description"
    runat="server"></meta>
    <meta id="MetaKeywords" name="keywords"
    runat="server"></meta>
    </HEAD>
    ...... rest of page

    I have got this setup so I can fill in the page title
    from a db. But every time when I open, change and save
    the page VS.NET removes the runat="server" for the
    <title> tag (not the rest).

    Can anyone tell me why VS does this?

    Thanks in advance!

    Ronald Colijn

    ps, it also changes the connection string to the db,
    instead of using the web.config referal (dynamic
    properties/connectionstring) it replaces referal to
    web.config with the connectionstring. This is very
    annoying also when I move the site to another server....

    ..
    Ronald Colijn, Nov 17, 2003
    #1
    1. Advertising

  2. The answer has actually been posted before, but here it is again.

    <title>
    <asp:Literal id="PageTitle" runat="server" />
    </title>

    Also, you need to do the following change.

    // before: protected System.Web.UI.HtmlControls.HtmlGenericControl PageTitle;
    // after ...
    protected System.Web.UI.WebControls.Literal PageTitle;


    I also had to change to using "PageTitle.Text" instead of "PageTitle.InnerText".

    Have fun!

    /Martin

    "Ronald Colijn" <> wrote in message news:<#>...
    > HELP,
    >
    > This is driving me crazy!
    >
    > I have made a asp.net page and at the top I have this:
    >
    > <HTML>
    > <HEAD>
    > <title id="PageTitle" runat="server">A Title</title>
    > <meta id="MetaDescription" name="description"
    > runat="server"></meta>
    > <meta id="MetaKeywords" name="keywords"
    > runat="server"></meta>
    > </HEAD>
    > ..... rest of page
    >
    > I have got this setup so I can fill in the page title
    > from a db. But every time when I open, change and save
    > the page VS.NET removes the runat="server" for the
    > <title> tag (not the rest).
    >
    > Can anyone tell me why VS does this?
    >
    > Thanks in advance!
    >
    > Ronald Colijn
    >
    > ps, it also changes the connection string to the db,
    > instead of using the web.config referal (dynamic
    > properties/connectionstring) it replaces referal to
    > web.config with the connectionstring. This is very
    > annoying also when I move the site to another server....
    >
    > .
    Martin Eklund, Nov 27, 2003
    #2
    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. J. Miller

    response redirect without asking

    J. Miller, Jul 9, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    410
    J. Miller
    Jul 9, 2003
  2. Hazzard
    Replies:
    2
    Views:
    532
    Yan-Hong Huang[MSFT]
    Jul 23, 2003
  3. Marina
    Replies:
    0
    Views:
    527
    Marina
    Jul 21, 2003
  4. =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=

    VS.NET designer removes runat='server' attribute in <title>

    =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=, Jul 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    354
    Joe Fallon
    Jul 15, 2004
  5. Klaus
    Replies:
    2
    Views:
    389
    Roedy Green
    Jun 29, 2004
Loading...

Share This Page