cannot view the design of the .aspx page
I have a datagrid column which goes as -
<asp:TemplateColumn HeaderText="New Inquiry Type">
<ItemTemplate>
<asp:Hyperlink ID="hplnkInquiryType" Runat="Server" text=<%#DataBinder.Eval(Container.DataItem,"invest or name").ToString()%>>
</asp:Hyperlink>
</ItemTemplate>
</asp:TemplateColumn>
when i try to view the page in the design mode i get this error --
Could not open in Design View . Place quotes around a '<% %>' block used as an attribute value or within a <SELECT> element.
it works when i wrap the text attribute within 2 single quotes -
<asp:TemplateColumn HeaderText="New Inquiry Type">
<ItemTemplate>
<asp:Hyperlink ID="hplnkInquiryType" Runat="Server" text='<%#DataBinder.Eval(Container.DataItem,"inves tor name").ToString()%>>'
</asp:Hyperlink>
</ItemTemplate>
</asp:TemplateColumn>
but then the Hyperlink on the datagrid throws an error when clicked as - <some investor name> undefined
i.e. coz it needs the investor_name to be wrapped around single quotes.
thus the hyperlink works with the following code but no design view --
<asp:TemplateColumn HeaderText="New Inquiry Type">
<ItemTemplate>
<asp:Hyperlink ID="hplnkInquiryType" Runat="Server" text="'" + <%#DataBinder.Eval(Container.DataItem,"investor name").ToString() + "'" %>>
</asp:Hyperlink>
</ItemTemplate>
</asp:TemplateColumn>
|