Re: Web Form acts differently when using C# than VB

From: Peter Blum (PLBlum_at_Blum.info)
Date: 02/15/04


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
>
>
>
>



Relevant Pages

  • Re: Static HTML using PHP
    ... you can do this by, instead of outputting your HTML code, catching it ... into a string, and when done parsing spit the HTML code into a file ... (I think more people should embrase caching). ... Matt Smyth wrote: ...
    (alt.php)
  • Re: CGI C and HTML
    ... > Consider this HTML code. ... > Does't interest to tokenize and to unescape the string. ... prog2 and prog3 that all read from stdin and write to stdout then on ...
    (comp.lang.c)
  • Re: [VB.NET express 2005] - Regular expressions
    ... Private Function findImgTags(ByVal strHTML As String) As Object ... Dim str As Object ... while if you meant html code, well imagine an html page with a serie of ... I would like to retrieve just the last one. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: mail
    ... >>HTML code in the string $message that you put into the mailfunction. ... >>impossible unless a clients computer is specifically set up to execute PHP ... >>Express and Firefox both install default with JScript and Java turned off. ... The body of an email is a string. ...
    (comp.lang.php)
  • RE: using Regex to split a string
    ... //regex expression to take out any ctrl + somekey values ... private System.Text.RegularExpressions.Regex Regx = new ... > How to use Regex to split the string so that It would return a String array ...
    (microsoft.public.dotnet.languages.csharp)