{"id":73,"date":"2012-09-10T13:36:05","date_gmt":"2012-09-10T20:36:05","guid":{"rendered":"http:\/\/www.writtinfool.com\/times\/?p=73"},"modified":"2012-09-20T11:07:02","modified_gmt":"2012-09-20T18:07:02","slug":"little-known-lessons","status":"publish","type":"post","link":"https:\/\/www.writtinfool.com\/times\/2012\/09\/little-known-lessons\/","title":{"rendered":"Little known lessons learned"},"content":{"rendered":"<blockquote>\n<p>In Asp.net, the tilde \u00e2\u20ac\u0153~\u00e2\u20ac\u009d is used to sort out paths to image files and such. However it doesn\u00e2\u20ac\u2122t work out side a control. This leads to problems when you put page files in subdirectories and you are using a Master page. The best policy is to leave the aspx file at top level and put images, user controls and such in subdirectories. This way relative path addresses aren\u00e2\u20ac\u2122t lost. for example an image file can be images\/myimage.png. This will only work if the Image directory is at the same level as the master page and the page calling the master page. If the aspx file is in a subdirectory the path is lost.&#160; <\/p>\n<\/blockquote>\n<blockquote>\n<p>Point of discovery: there are asp.net folders, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ex526337(v=vs.100).aspx\" target=\"_blank\">Asp.Net Web Project Folder structure<\/a> one of which is an App_ Themes folder where skins, css files and I guess images can be stored. I\u00e2\u20ac\u2122ll check this out more as a way to over come the above issue.<\/p>\n<\/blockquote>\n<blockquote>\n<p>Bind as used in Asp.Net controls looks like a function call but isn\u00e2\u20ac\u2122t. It is a statement. Here is&#160; a good discussion of that:<\/p>\n<p><a href=\"http:\/\/weblogs.asp.net\/leftslipper\/archive\/2007\/06\/29\/how-asp-net-databinding-deals-with-eval-and-bind-statements.aspx\" target=\"_blank\">how asp.net databinding deals with eval and bind statements<\/a>&#160; <\/p>\n<p>For our purposes we can call it like a function with one required and one optional parameter. The second parameter can only be a format string which is applied to the data you are binding to.&#160; <\/p>\n<p>Some people like to try using string.format but that is very tricky because string.format wants to use \u00e2\u20ac\u0153Bind\u00e2\u20ac\u009d as a function and winds up not being recognized. I have had better luck just using bind with a format string. See this example: <a href=\"http:\/\/forums.asp.net\/t\/1171122.aspx\/1\" target=\"_blank\">Forum Label format question<\/a><\/p>\n<p>I think a better place to use string.format is in&#160; your server side code. I would write a function that uses it and call the function in your control. Just make sure the return value is public. <\/p>\n<p>some good Links on format strings:<\/p>\n<p>Formatting types: <a title=\"http:\/\/msdn.microsoft.com\/en-us\/library\/26etazsy\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/26etazsy\">http:\/\/msdn.microsoft.com\/en-us\/library\/26etazsy<\/a><\/p>\n<p>Custom numeric format strings: <a title=\"http:\/\/msdn.microsoft.com\/en-us\/library\/0c899ak8.aspx#SpecifierD\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/0c899ak8.aspx#SpecifierD\">http:\/\/msdn.microsoft.com\/en-us\/library\/0c899ak8.aspx#SpecifierD<\/a><\/p>\n<p>Standard numeric format strings: <a title=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dwhawy9k\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dwhawy9k\">http:\/\/msdn.microsoft.com\/en-us\/library\/dwhawy9k<\/a><\/p>\n<p>See this for: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.string.format.aspx\" target=\"_blank\">msdn String.Format method<\/a><\/p>\n<\/blockquote>\n<blockquote>\n<p>Something I just learned about using the <a href=\"http:\/\/www.mantisbt.org\/\" target=\"_blank\">Mantis bug tracking system<\/a>;To use the Change log and roadmap features of MantisBT, you have to set versions in a project. <\/p>\n<p>1. Under the Manage Menu click Manage projects, <\/p>\n<p>2. scroll down to versions, <\/p>\n<p>3. type a version number, <\/p>\n<p>4. click add and edit, <\/p>\n<p>5. and unclick released. <\/p>\n<p>The Change log and roadmap features ONLY work for un-released versions of a project. They also don\u00e2\u20ac\u2122t work for projects with NO versions. The File-&gt;print preview looks pretty good too. I think this would be very useful for management reporting.<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>In Asp.net, the tilde \u00e2\u20ac\u0153~\u00e2\u20ac\u009d is used to sort out paths to image files and such. However it doesn\u00e2\u20ac\u2122t work out side a control. This leads to problems when you put page files in subdirectories and you are using a Master page. The best policy is to leave the aspx file at top level and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_seo_schema_type":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[12],"tags":[],"class_list":["post-73","post","type-post","status-publish","format-standard","hentry","category-web-development"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.writtinfool.com\/times\/wp-json\/wp\/v2\/posts\/73","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.writtinfool.com\/times\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.writtinfool.com\/times\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.writtinfool.com\/times\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.writtinfool.com\/times\/wp-json\/wp\/v2\/comments?post=73"}],"version-history":[{"count":13,"href":"https:\/\/www.writtinfool.com\/times\/wp-json\/wp\/v2\/posts\/73\/revisions"}],"predecessor-version":[{"id":86,"href":"https:\/\/www.writtinfool.com\/times\/wp-json\/wp\/v2\/posts\/73\/revisions\/86"}],"wp:attachment":[{"href":"https:\/\/www.writtinfool.com\/times\/wp-json\/wp\/v2\/media?parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.writtinfool.com\/times\/wp-json\/wp\/v2\/categories?post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.writtinfool.com\/times\/wp-json\/wp\/v2\/tags?post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}