In Asp.net, the tilde “~” is used to sort out paths to image files and such. However it doesn’t 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’t 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. 

Point of discovery: there are asp.net folders, Asp.Net Web Project Folder structure one of which is an App_ Themes folder where skins, css files and I guess images can be stored. I’ll check this out more as a way to over come the above issue.

Bind as used in Asp.Net controls looks like a function call but isn’t. It is a statement. Here is  a good discussion of that:

how asp.net databinding deals with eval and bind statements 

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. 

Some people like to try using string.format but that is very tricky because string.format wants to use “Bind” as a function and winds up not being recognized. I have had better luck just using bind with a format string. See this example: Forum Label format question

I think a better place to use string.format is in  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.

some good Links on format strings:

Formatting types: http://msdn.microsoft.com/en-us/library/26etazsy

Custom numeric format strings: http://msdn.microsoft.com/en-us/library/0c899ak8.aspx#SpecifierD

Standard numeric format strings: http://msdn.microsoft.com/en-us/library/dwhawy9k

See this for: msdn String.Format method

Something I just learned about using the Mantis bug tracking system;To use the Change log and roadmap features of MantisBT, you have to set versions in a project.

1. Under the Manage Menu click Manage projects,

2. scroll down to versions,

3. type a version number,

4. click add and edit,

5. and unclick released.

The Change log and roadmap features ONLY work for un-released versions of a project. They also don’t work for projects with NO versions. The File->print preview looks pretty good too. I think this would be very useful for management reporting.

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *