简体   繁体   English

服务器标记格式不正确的错误ASP.NET

[英]The Server Tag is not well formatted error ASP.NET

I am trying to figure out why I am getting the server tag is not well formed error in the following codes. 我试图弄清楚为什么我在以下代码中得到服务器标签格式错误。 on Line 61. Any explanation will be appreciated. 在线61。任何解释将不胜感激。

        <td>
                        <asp:Label ID="lblPharmName" runat="server" Text='<%# Eval("p.Pharm_fname + ' ' + p.Pharm_lname") %>'>
                        </asp:Label>                        
                    </td>

The full page of that code is below: 该代码的完整页面如下:

     <%@ Page Language="VB" MasterPageFile="~/CIOSMasterNonAuth.master" AutoEventWireup="false"    CodeFile="ViewOrders.aspx.vb" Inherits="ViewOrders" title="Untitled Page" %>

     <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

     <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <%--<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>--%>
    <asp:Table runat="server" Font-Size="Small" HorizontalAlign="Center">
    <asp:TableRow>
    <asp:TableCell HorizontalAlign="Right">
    <asp:Label runat="server">Order Status: </asp:Label>
    </asp:TableCell>
    <asp:TableCell HorizontalAlign="Left">
     <asp:DropDownList ID="OrderStatusDropDownList" runat="server" AutoPostBack="True">
         <asp:ListItem Text="Verified" Value="V" />
         <asp:ListItem Text="New" Value="N" />
         <asp:ListItem Text="Cancelled" Value="C" />
         </asp:DropDownList>
         </asp:TableCell>
         </asp:TableRow>
     <asp:TableRow>
     <asp:TableCell ColumnSpan="2">
        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
        <HeaderTemplate>
                <table border="1" visible="false">
                    <tr>
                        <th>
                            Web Order ID
                        </th>
                        <th>
                            Web Entry Date
                        </th>
                        <th>
                            Protocol Number
                        </th>
                        <th>
                            Site Number
                        </th>
                        <th>
                            Pharmacist of Record
                        </th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <asp:LinkButton runat="server" ID="lnkOrderDetails" Text='<%# Eval("web_order_id") %>' OnClick="lnkOrderDetails_Click" />
                    </td>
                    <td>
                        <asp:Label ID="lblWebEntryDate" runat="server" Text='<%# Eval("web_entry_date") %>'>
                        </asp:Label>
                    </td>
                        <td>
                        <asp:Label ID="lblProtocolNum" runat="server" Text='<%# Eval("protocol_num") %>'>
                        </asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="lblSiteNum" runat="server" Text='<%# Eval("site_num") %>'>
                        </asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="lblPharmName" runat="server" Text='<%# Eval("p.Pharm_fname + ' ' + p.Pharm_lname") %>'>
                        </asp:Label>                        
                    </td>

                </tr>
                 </ItemTemplate>
                <FooterTemplate>
                    </table>
                  </FooterTemplate>
           </asp:Repeater>
           </asp:TableCell>
            </asp:TableRow>
        </asp:Table>

      <asp:Button runat="server" ID="btnShowModalPopup" style="display:none"/>
           <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
            TargetControlID="btnShowModalPopup"
            PopupControlID="divPopUp" 
              PopupDragHandleControlID="panelDragHandle">
    </cc1:ModalPopupExtender>

        <div id="divPopUp" style="display:none; font-family:Georgia; font-size:small;">
                                                                                                                       <asp:Panel runat="Server" ID="panelDragHandle" BackColor="#009999" BorderColor="ActiveBorder"   BorderStyle="Ridge" ForeColor="White" Width="800px">
     <table width="100%">
     <tr>
     <td>
         Hold here to Drag this Box
        </td>
        <td align="right">
     <asp:Label runat="server" ID="lblText" Text="Web OrderID: " ForeColor="White"></asp:Label>

     <asp:Label ID="lblWebOrderID" runat="server"></asp:Label>
     </td>
     </tr>
     <tr>
     <td colspan="2"> 
     <asp:GridView ID="GridView2" runat="server" BackColor="#FFFFCC" ForeColor="Black" AutoGenerateColumns="False" Width="100%" >

     <Columns>
     <asp:BoundField DataField="line_id" HeaderText="Line Item"/>
     <asp:BoundField DataField="no_of_participants" HeaderText="Number of Participants" />
     <asp:BoundField DataField="amt_inventory" HeaderText="Current Inventory"/>
     <asp:BoundField DataField="nsc_num" HeaderText="NSC number"/>
     <asp:BoundField DataField="drug_name" HeaderText="Drug name"/>
     <asp:BoundField DataField="dose_str" HeaderText="Dose Strength"/>
     <asp:BoundField DataField="dose_unit" HeaderText="Dose Unit"/>
     <asp:BoundField DataField="dose_form_comment" HeaderText="Dose Form"/>
     <asp:BoundField DataField="dose_mult" HeaderText="Dose Mult" />
     <asp:BoundField DataField="amt_req" HeaderText="Amt Required"/>
     </Columns>
     </asp:GridView> 
     </td> 
     </tr>
     <tr> 
     <td colspan="2" align="right">                       
    <asp:Button ID="btnClose" runat="server" Text="Close" />
    </td>
    </tr>
    </table>
    </asp:Panel>
   <br />

 </div>

<% 
    Response.AddHeader("Refresh", "60")
%>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CIOSConnectionString3 %>" 


        SelectCommand="SELECT w.web_order_id, w.web_entry_date, w.site_num, w.protocol_num, w.inv_num, w.pharm_num, w.status, w.Comments, w.UserName, w.porStatus, p.Pharm_fname + ' ' + p.Pharm_lname AS 'PharmName' FROM Web_Shipping AS w INNER JOIN Pharmacist_of_record AS p ON p.pharm_num = w.pharm_num WHERE (w.status = @status) ORDER BY w.web_order_id DESC" >
         <SelectParameters>
            <asp:ControlParameter ControlID="OrderStatusDropDownList" Name="Status" 
                PropertyName="Text" Type="Char" />
                </SelectParameters>
        </asp:SqlDataSource>

                                                                                                     <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$   ConnectionStrings:CIOSConnectionString3 %>" 

        SelectCommand="SELECT Web_Ship_detail.line_id, Web_Ship_detail.no_of_participants, Web_Ship_detail.Amt_inventory, Web_Ship_detail.NSC_num, Web_Ship_detail.Dose_str, Web_Ship_detail.Dose_unit, Web_Ship_detail.Dose_mult, Web_Ship_detail.amt_req, Drug.Drug_name, Dosage_Form.dose_form_comment FROM Web_Ship_detail INNER JOIN Drug ON Web_Ship_detail.NSC_num = Drug.NSC_Num INNER JOIN Dosage_Form ON Web_Ship_detail.Dose_form = Dosage_Form.dose_form WHERE   (Web_Ship_detail.web_order_id = @web_order_id) ORDER BY Web_Ship_detail.line_id">
        <SelectParameters>
            <asp:ControlParameter ControlID="lblWebOrderID" Name="web_order_id" 
                PropertyName="Text" Type="Decimal" />
        </SelectParameters>

    </asp:SqlDataSource>



    enter code here
    </asp:Content>

you can replace your single quotes with double as single quotes are for starting and ending of string like as: 您可以将双引号替换为双引号,因为单引号用于字符串的开始和结束,例如:

<asp:Label ID="lblPharmName" runat="server" Text='<%# Eval("p.Pharm_fname " + "p.Pharm_lname") %>'>
                    </asp:Label>    

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM