Click here to Skip to main content
15,041,391 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a custom web control for use on various linklist pages. Its usage looks like this:

VB
<mine:DispatchLink ID="admin_rep_1" runat="server"
    NavigateUrl="#"
    Text="View Your Renewal Fee Invoice"
    ExtendedText="Extended description." />


Some of the ExtendedText values are rather long (they are set by management, not me.) To make maintenance a bit easier, I would like to do something like this:

VB
<mine:DispatchLink ID="admin_rep_1" runat="server"
    NavigateUrl="#"
    Text="View Your Renewal Fee Invoice"
    ExtendedText="Extended " + 
        "description." />


This generates a compile error on the page, complaining that "the server tag is not well formed." Is there a way to split the value of a web control's tag across multiple lines, or am I stuck putting the entire string on a single line?
Posted

1 solution

You can't break up a string literal like this.

You could do this, however it will treat all the white space as being included in the literal

ExtendedText="Extended  
        description." />
   
Comments
Gregory Gadow 15-Jul-10 23:47pm
   
That shouldn't be a problem, as the extended text gets used as both the anchor's title attribute and (in some cases) a label with a description after the link. Carriage returns should work fine in both those situations. Thanks!

Added: Works perfectly. The line breaks are used in the text, but that doesn't cause any problems; I can trim them out in my web control if I want to be picky. Thanks again.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900