Thursday, April 30, 2009

CHMOD, UNIX Permission

I tried to find a good example of how to give all permissions in chmod.
They are very hard to find.

If you want to give all permissions to all files in a directory type

chmod 777 * for all files without an extention
chomd 777 *.* for all files with an extention

hope this helps.

Monday, April 27, 2009

ASP.NET MVC Html.DropDownList

It took me a little while to figure out how to add custom items to an ASP.net MVC Html dropdownlist.  

It takes an IEnumerable of type SelectedList, not just any IEnumerable.  What I had to do was create a List and then make a SelectedList and put that List in the selected list for it to work.

Like this:


Thursday, April 23, 2009

ASP.NET MVC usercontrol

There are a few things I found out about ASP.Net MVC user controls.

1. The user control cannot be contained in asp:content blocks.  The code must be in "the open".
2. You can pass the ViewData as a parameter.
3. To render the user control you must:



4. You do not need the '.ascx' after the name of the view.

Friday, April 17, 2009

ASP.NET MVC HTML helpers attributes

In order to set attributes for html elements using
"Html.ActionLink(, , , )"

The attributes should be like
new { @attribute=value, ...})

an example of this would be:
new { @id=doneID, @class="invisible"})

The "doneID" is a string variable that was defined earlier in the ' ' of the page.
The @class value is just a string.



Monday, April 13, 2009

ASP.NET MVC Masterpage Image

I had a problem trying to figure out a way to display an image on a master page and have that image display on all child pages.

I could get it to show the image on all child pages in the IDE, but when I would publish, the image would not show.

My problem was fixed by creating a "class" in my Site.css file.
You can put this code anywhere in that file, but it would be good practice to group classes by logical function.

/*
SAMPLE
*/
.photo-container
{
padding:10px;
border:1px dotted #7a7a7a;
}

To display the image in the master page, this code worked for me.

Make a "div", make the "div" "class='photo-container'". style="width:auto;"> "img src="../../[Folder]/ [File].jpg" />

Type the code where you want your image to be. I hope this helps.

Saturday, April 11, 2009

In The Beginning...

This is my first blog post.

The purpose of this blog is to show and explain technical ideas and coding algorithms.

I have a "dark" them, because that is what I code in. I find it easier on the eyes.

Thanks,

Rybo