IF Len statement in EWD (Full Version)

All Forums >> [Web Development] >> Expression Web Help



Message


marabe -> IF Len statement in EWD (9/4/2007 17:00:15)

Hi,

I've used FP mostly and try to get around EWD. I have an old if len statement from a DRW that I wish to modify to expression web. Is this doable in design view or do I need to re-code it manually. And in that case, can anyone help me with the syntax in EW?

<a class="menyleft" href="read_recension.asp?key=<%=FP_FieldLink(fp_rs,"Key")%>" title="Av <%=FP_Field(fp_rs,"Author_Name")%>">
<%
If len(FP_Field(fp_rs,"Titel")) > 20 then
response.write Left(FP_Field(fp_rs,"Titel"), 20) &".."
else
response.write (FP_Field(fp_rs,"Titel"))
end if
%>
</a>

/Best




rdouglass -> RE: IF Len statement in EWD (9/5/2007 9:26:15)

What specifically is the issue? Does this not run / error out?




marabe -> RE: IF Len statement in EWD (9/6/2007 4:50:07)

First I tried to find possible solution i design view, but i guess it's not available.

I'm no coder, but I tried a similar approach on the EW code:

<asp:hyperlinkfield HeaderText="linkreview"

<% If len(DataTextField="Titel") > 18 then
response.write Left(DataTextField="Titel"), 18) &".."
else
response.write DataTextField="Titel"
end if
%>

DataNavigateUrlFormatString="read_recension.asp?key={0}" DataNavigateUrlFields="Key">
<ControlStyle CssClass="menyleft" />
</asp:hyperlinkfield>

</asp:hyperlinkfield>


I get this error, so i guess I'm on the wrong track:

Parser Error Message: Literal content ('<asp:hyperlinkfield HeaderText="linkreview"') is not allowed within a 'System.Web.UI.WebControls.DataControlFieldCollection'.
/Best




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625