I'll have to start with :sad: .
I'm trying to customize BVC5 but it seems to be a lost battle:
http://www.bvsoftware.com/Forums/default.aspx?f=78&m=39976 <SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">Now, let's say I don't have to go to WebApps. A website is good enough so I should just try to use it.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">However this is not the case. If you try to customize BVC5 you have to start editing the BV files if you want to achieve anything else than CSS styles. This is (unfortunately) because the VB codes generates ALOT of html code. This is simply WRONG.<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">The VB code should never try to generate HTML code. That’s the whole point of ASP.Net. You build controls and you reuse them. You want to create a new link you do a<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">Dim myLink as new HyperLink<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">myLink.Text = “click me”<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">myLink.NavigateUrl = “http://wherever you want”<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><o:p> </o:p>
[3]However in BV5 there is a bunch of <SPAN style="mso-spacerun: yes"> [/3]<SPAN style="FONT-SIZE: 8pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-language: EN-US; mso-no-proof: yes">sb.Append("<a href=""categories.aspx?id=0"">Root</a>").<o:p></o:p>
[3]Maybe one of the worse is when you see things like:[/3]
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-language: EN-US; mso-no-proof: yes">sb.Append(<SPAN style="COLOR: maroon">"<div class=""recordimage"">")<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-language: EN-US; mso-no-proof: yes">sb.Append(<SPAN style="COLOR: maroon">"<a href=""")<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-language: EN-US; mso-no-proof: yes">sb.Append(destinationLink)<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-language: EN-US; mso-no-proof: yes">sb.Append(<SPAN style="COLOR: maroon">"""><img src=""")<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-language: EN-US; mso-no-proof: yes">sb.Append(imageUrl)<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-language: EN-US; mso-no-proof: yes">sb.Append(<SPAN style="COLOR: maroon">""" border=""0"" alt=""")<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-language: EN-US; mso-no-proof: yes">sb.Append(p.ProductName)<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-language: EN-US; mso-no-proof: yes">sb.Append(<SPAN style="COLOR: maroon">" ")<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-language: EN-US; mso-no-proof: yes">sb.Append(p.Sku)<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-language: EN-US; mso-no-proof: yes">sb.Append(<SPAN style="COLOR: maroon">""" /></a>")<o:p></o:p>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-language: EN-US; mso-no-proof: yes">sb.Append(<SPAN style="COLOR: maroon">"</div>")<o:p></o:p>
[3]Helloo. OOP? Code Reuse?[/3]
[3]Make a user control and reuse it across your classes. That will allow me to set CSS styles on the elements. That will allow me to replace just the child user control and still get the display model defined by the category template. Right now all the display model is hard coded in the template. Seeing this code remembers me of the ASP era when all the code was a mix & match of html and vb script
and makes me cry.[/3]
[3]One more that it just started to rewrite: [/3]<SPAN style="FONT-SIZE: 8pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-language: EN-US; mso-no-proof: yes">Controls.Add(New LiteralControl("<li>"))
[3]ASP.Net has a nice asp:bulletlist and if that is not good enough there is the asp:repeater. So I can define my item template and the elements and so on IN the ASP code. IN the presentation layer.[/3]
[3]Same type of issues: [/3]<SPAN style="FONT-SIZE: 8pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-language: EN-US; mso-no-proof: yes">sb.Append("<tr><td class=""formlabel"">")[3]. There is a asp:gridview and asp:datagrid and asp:datalist and all of them can generate you nice tables or divs or whatever you need for each product/category/element whatever you need. [/3]
[3]The good part is that some controls are really done the correct way. For example a “by the book control” is the ProductReviewDisplay that has a nice DataList with ItemTemplate and so on. [/3]
[3]Sorry for whinging so much. I spent my last 10 evenings customizing BVC5 and the more I change it the more I start crying.[/3]
[3]So, Marcus, if you want to release SP1 for BVC5, I think one of the first things to change is the code. Make user controls. Reuse code. Make it OOP.[/3]
<o:p>[3]Corneliu.[/3]</o:p>