Error: Identifier expected

Last post 07-05-2009 2:06 AM by naamaGold. 6 replies.

Sort Posts:

  • Error: Identifier expected

    07-01-2009, 4:31 AM
    • Member
      25 point Member
    • naamaGold
    • Member since 10-22-2007, 3:24 AM
    • Posts 92

     I have the following code which generates an error in the URL param of "Identifier expected"

    Can anyone see what is missing?

    <object CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" ID="MediaPlayer" type="application/x-oleobject" NAME="Player" WIDTH="320" HEIGHT="300" hspace="0" vspace="0">
    <param name="URL" value="http://www.mywebsite.org/VideoPage/Videos/<%=Request.QueryString["vID"]%>" />
    <param NAME="AUTOSTART" VALUE="true"/> 
    <param name="showControls" value="true"/>

    <embed WIDTH="320" HEIGHT="300" align="center" hspace="10" SRC="http://www.mywebsite.org/VideoPage/Videos/<%=Request.QueryString["vID"]%>" TYPE="application/x-oleobject" AUTOSTART="true">
    </embed>

     </object>

    <asp:DataList id="ProductsTable" DataSourceID="SqlDataSource1" Runat="Server" GridLines="None" Width="100%" CellPadding="1" CellSpacing="3" RepeatColumns="3" RepeatDirection="Horizontal" ItemStyle-Font-Size="10pt" ItemStyle-VerticalAlign="Top"> 

     <ItemTemplate >
    <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Bind("videoName") %>' NavigateUrl='<%# "Default.aspx?vID=" & Container.DataItem("vID") %>' /> </ItemTemplate>

     </asp:DataList>

     

     <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString1 %>"
    ProviderName="<%$ ConnectionStrings:DatabaseConnectionString1.ProviderName %>" SelectCommand="SELECT * FROM [Video] ORDER BY videoName">

     <SelectParameters>
    <asp:QueryStringParameter Name="vID" QueryStringField="vID" Type="string" />
    </SelectParameters>

     </asp:SqlDataSource>

  • Re: Error: Identifier expected

    07-01-2009, 5:32 AM
    • Participant
      984 point Participant
    • SpongeBert
    • Member since 08-10-2006, 10:21 PM
    • Posts 1,077

     Hello,

     

    are you sure you have a querystring. Which fields are stored in database for vzxsvideo table?

     

    Kind Regards

    Please give us feedback no matter whether you get your answer.
    Please "mark as answer" if it's useful for you

    Sincerely,
    SpongeBert
  • Re: Error: Identifier expected

    07-01-2009, 5:37 AM
    • Member
      516 point Member
    • arry.net
    • Member since 07-04-2008, 9:42 AM
    • Posts 135

    ah..
    it's a very commomn(Syntax) problem some time it takes too much time
    but You can try with
    <asp:DataList id="ProductsTable"
    TRy ID <ID in caps> And
    and try to maintan single space between the lines
     
    You can also check variable names declared in ur cs file that they are not clashing with design controls

    arry.net
  • Re: Error: Identifier expected

    07-01-2009, 5:57 AM
    • Member
      25 point Member
    • naamaGold
    • Member since 10-22-2007, 3:24 AM
    • Posts 92

     The link to this page so far is

    <asp:HyperLink ID="HyperLink1" NavigateUrl="~/VideoPages/Default.aspx?vID=1" runat="server">HyperLink</asp:HyperLink>

    The fields are vID, videoName and videoURL

  • Re: Error: Identifier expected

    07-01-2009, 10:27 AM
    • Participant
      1,547 point Participant
    • ctheriault
    • Member since 04-10-2009, 4:33 PM
    • Posts 276

    Glancing at it I noticed an issue with double quotes.

    For instance in the expressions:

    < param name ="URL" value ="http://www.mywebsite.org/VideoPage/Videos/ <%=Request.QueryString["vID"]%> " />

    and

    < embed WIDTH ="320" HEIGHT "300" align ="center" hspace ="10" SRC ="http://www.mywebsite.org/VideoPage/Videos/ <%=Request.QueryString["vID"]%> " TYPE ="application/x-oleobject" AUTOSTART ="true">

    in both a inner expression is using double quote as well.

    Try instead:

    < param name ="URL" value ='http://www.mywebsite.org/VideoPage/Videos/ <%=Request.QueryString["vID"]%> ' />

    and

    < embed WIDTH ="320" HEIGHT "300" align ="center" hspace ="10" SRC ='http://www.mywebsite.org/VideoPage/Videos/ <%=Request.QueryString["vID"]%> ' TYPE ="application/x-oleobject" AUTOSTART ="true">

    ----
    Don't forget to mark this posting as an "Answer" if it is helpful to you
  • Re: Error: Identifier expected

    07-02-2009, 8:47 AM
    Answer

    naamaGold:

    I have the following code which generates an error in the URL param of "Identifier expected"

    Can anyone see what is missing?

    Hi,

    Please have a check on your page's language. I doubt that you are using VB.NET but the Request.QueryString() method is in C# format.

    So, change the first param tag to the like below, which replaces the "[]" with "()", and have another try:

    <param name="URL" value="http://www.mywebsite.org/VideoPage/Videos/<%=Request.QueryString("vID")%>" />

    Best Regards,
    Shengqing Yang

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread : )
  • Re: Error: Identifier expected

    07-05-2009, 2:06 AM
    • Member
      25 point Member
    • naamaGold
    • Member since 10-22-2007, 3:24 AM
    • Posts 92

    You got it!! Thank you for the lateral thinking!

    I did program in VB.net and never noticed the [].

    Thank you for answering!

Page 1 of 1 (7 items)