Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 18th, 2005, 10:53 AM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default BC30201: Expression expected.

Good Morning,

I'm trying to run this ASP.Net Page, but compiler shows this message:
BC30201: Expression expected.

The source code is this:

<%@ Import Namespace="System.Data" %>

<script language="VB" runat="server">
    Public Sub Page_Load(obj as Object, e as EventArgs)
        If Not Page.IsPostBack Then
            Session.Clear
            Calendar1.SelectedDate = DateTime.Now
            EtiqDia.Text='<%# Calendar1.SelectedDate.Format("dddd, MMMM dd yyyy", nothing ) %>'
            DataBind()
        End If
    End Sub

    Public Sub OpcionCambiada(obj as Object, e as EventArgs)
        EtiqDia.Text='<%# Calendar1.SelectedDate.Format("dddd, MMMM dd yyyy", nothing ) %>'
        If Not (Session(Calendar1.SelectedDate.ToString) is _
            nothing)
            Dim l as Label = New Label
            l.Text = Session(Calendar1.SelectedDate.ToString)
            PanelDia.Controls.Add(l)
        End If
        DataBind()
    End Sub

    Public Sub NotaModificada(obj as Object, e as EventArgs)
        If obj.Text <> "" Then
            Dim l as Label = New Label
            l.Text = "<li>" & obj.Text & "</li>"

            PanelDia.Controls.Add(l)
            Session(Calendar1.SelectedDate.ToString) = l.Text
            CuadroNota.Text = ""
        End If
    End Sub
</script>

Help me please





Regards,

Héctor Camilo Ramírez Pereira
[email protected]
[email protected]
 
Old May 18th, 2005, 11:48 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

This won't work:

EtiqDia.Text='<%# Calendar1.SelectedDate.Format("dddd, MMMM dd yyyy", nothing ) %>'

Try this:

EtiqDia.Text=Calendar1.SelectedDate.Format("dddd, MMMM dd yyyy", nothing )

Databinding syntax only goes in the markup.

-Peter
 
Old May 19th, 2005, 10:53 PM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Peter.

But I had another question:

In this routine

Public Sub Page_Load(obj as Object, e as EventArgs)
   If Not Page.IsPostBack Then
    Session.Clear
    Calendar1.SelectedDate = DateTime.Now
    EtiqDia.Text=Calendar1.SelectedDate.Format("dddd, MMMM dd yyyy", nothing )
    DataBind()
   End If
End Sub

Compiler displays this Compiler Error Message: BC30456: 'Format' is not a member of 'Date'.

¿May you help me?




Regards,

Héctor Camilo Ramírez Pereira
[email protected]
[email protected]
 
Old May 20th, 2005, 09:18 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Try Calendar1.SelectedDate.ToString("dddd, MMMM dd yyyy")

http://msdn.microsoft.com/library/en...ringTopic3.asp

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Expected Expression before')' token page 212 line martyds BOOK Beginning Linux Programming, 3rd Edition 0 November 9th, 2008 04:44 PM
XPath Error : Expression Expected deean XML 1 June 14th, 2008 05:57 PM
Message> in query expression <expression>. (Error ybg1 Access 5 July 15th, 2007 05:42 AM
expected ';' RoniR Javascript 3 February 1st, 2007 05:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.