Re: Web Form acts differently when using C# than VB
From: Peter Blum (PLBlum_at_Blum.info)
Date: 02/15/04
- Next message: Stephane Viau: "Re: invalid url and proxy"
- Previous message: Peter Blum: "Re: Validations......"
- In reply to: Joe Fallon: "Web Form acts differently when using C# than VB"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 15 Feb 2004 17:53:19 -0500
I don't think the language itself is the problem. I also don't see an error
with your code. However, two things come to mind:
1. In your translation, you didn't correctly assign "SomeKey" to
Context.Items. I always recommend using this form of adding to a collection:
Context.Items.Add("name", value)
over
Context.Items("name") = value
2. The value of "SomeKey" is not a string. It must be converted to a string.
Use "Context.Items("SomeKey").ToString()"
--- Peter Blum
www.PeterBlum.com
Email: PLBlum@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
"Joe Fallon" <jfallon1@nospamtwcny.rr.com> wrote in message
news:%23AVorb28DHA.2760@TK2MSFTNGP09.phx.gbl...
> I have a sample web form in C# that works correctly.
> When I translated it to VB I can't get one feature in it working.
> ==============================================
> The part that does not work in VB is:
> <%= Context.Items["SomeKey"] %>
> and:
> <%= this.SomeProperty %>
>
> ==============================================
> Part of the C# HTML code looks like this:
> <HTML>
> <HEAD>
> <title>
> <%= Context.Items["SomeKey"] %>
> </title>
> <%= this.SomeProperty %>
> </HEAD>
>
> ==============================================
> Part of the VB HTML code looks like this:
> <HTML>
> <HEAD id="Head" runat="server">
> <title>
> <%= Context.Items("SomeKey") %>
> </title>
> <%= Me.SomeProperty %>
> </HEAD>
>
> ==============================================
>
> When I remove the <% %> type of code from the HTML my page runs correctly.
> But I get a blank page when I leave it in.
>
> Any ideas?
>
> --
> Joe Fallon
>
>
>
>
- Next message: Stephane Viau: "Re: invalid url and proxy"
- Previous message: Peter Blum: "Re: Validations......"
- In reply to: Joe Fallon: "Web Form acts differently when using C# than VB"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|