ASP.NET C# Datagrid Quotation mark problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chathura86
    New Member
    • May 2007
    • 227

    ASP.NET C# Datagrid Quotation mark problem

    hi

    i got the following error when i was working with a datagrid

    i tried to bind a value to a text box in datagrid

    Code:
    <asp:TemplateColumn HeaderText="PRICE" ItemStyle-HorizontalAlign="Center">
    	<ItemTemplate>
    		<asp:TextBox ID="txtPrice" CssClass="textbox" Width="100" 
    		Style="text-align:right" Text="<%# DataBinder.Eval(Container, DataItem.Email") %>" runat="server />
    	</ItemTemplate>
    </asp:TemplateColumn>
    But this gives an error (The server tag is not well formed)

    untill i change quotesion mark of

    Code:
    Text="<%# DataBinder.Eval(Container, DataItem.Email") %>"
    double quotes

    to

    Code:
    Text='<%# DataBinder.Eval(Container, DataItem.Email") %>
    single quotes

    is it the correct way or am i missing any configuration or something

    i'm new to asp.net

    thank you

    Chathura Bamunusinghe
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Why don't you try "DataItem.Email "? If this fails use 'DataItem.Email '.

    Comment

    • chathura86
      New Member
      • May 2007
      • 227

      #3
      thanks for the help

      seems the inner string cause the problem

      '<%# DataBinder.Eval (Container, "DataItem.PRICE ") %>'

      is working but

      "<%# DataBinder.Eval (Container, "DataItem.PRICE ") %>"

      not working because "DataItem.PRICE " is also enclosed with double quotes

      thanks again

      regards

      Comment

      Working...