G
Guest
Hello All:
I am writing to ask for your opinions. I have a colleague who combines his
code with the markup used to display the code (reckoning back to classic
ASP). Here's an example of a datagrid column:
<asp:TemplateColumn>
<ItemStyle CssClass="TableData" Width="15%"></ItemStyle>
<ItemTemplate>
<a href="<%# ShowURL(DataBinder.Eval(Container.DataItem,
"FORM_ID"))%>" target="_blank">
<%# DataBinder.Eval(Container.DataItem, "FORM_NUMBER")%></a>
</ItemTemplate>
</asp:TemplateColumn>
or another column
<asp:TemplateColumn>
<ItemStyle CssClass="TableData" Width="20%"></ItemStyle>
<ItemTemplate>
<%# DisplayState(DataBinder.EvalContainer.DataItem,
"FORM_STATE_CD"))%>
</ItemTemplate>
</asp:TemplateColumn>
Where ShowURL and DisplayState are defined in the code-behind. We have the
restriction that we can not use ViewState when creating our webforms
(security breach due to how they have architected their web app). I wonder
if there is a bettre way to do this.
In my opinion, this is sloppy programming. I, however, could be wrong.
Maybe this is the best way to do this. So I am asking:
What is your opinion regarding mixiing content and functionality.
If you think that this could have been done differnetly, What would you have
done? Is there a better way to do this?
Finally, the IDE will not display the Design View of the page that contains
this markup. The message says "Could not open in Design View. Quote values
differently inside of a '<% ...value... %>' block."
Thank you for your input.
I am writing to ask for your opinions. I have a colleague who combines his
code with the markup used to display the code (reckoning back to classic
ASP). Here's an example of a datagrid column:
<asp:TemplateColumn>
<ItemStyle CssClass="TableData" Width="15%"></ItemStyle>
<ItemTemplate>
<a href="<%# ShowURL(DataBinder.Eval(Container.DataItem,
"FORM_ID"))%>" target="_blank">
<%# DataBinder.Eval(Container.DataItem, "FORM_NUMBER")%></a>
</ItemTemplate>
</asp:TemplateColumn>
or another column
<asp:TemplateColumn>
<ItemStyle CssClass="TableData" Width="20%"></ItemStyle>
<ItemTemplate>
<%# DisplayState(DataBinder.EvalContainer.DataItem,
"FORM_STATE_CD"))%>
</ItemTemplate>
</asp:TemplateColumn>
Where ShowURL and DisplayState are defined in the code-behind. We have the
restriction that we can not use ViewState when creating our webforms
(security breach due to how they have architected their web app). I wonder
if there is a bettre way to do this.
In my opinion, this is sloppy programming. I, however, could be wrong.
Maybe this is the best way to do this. So I am asking:
What is your opinion regarding mixiing content and functionality.
If you think that this could have been done differnetly, What would you have
done? Is there a better way to do this?
Finally, the IDE will not display the Design View of the page that contains
this markup. The message says "Could not open in Design View. Quote values
differently inside of a '<% ...value... %>' block."
Thank you for your input.