Posted by elberon5
Fri, 28 Sep 2007 13:40:00 GMT
Ok. I wish I had found this HyperLinkField bound field type a long time ago. This is the perfect field type for making links in a gridview when you need to include fields in the querystring of the URL. I wont get into the hacks i've attempt to get around this one.
Basically there's two important properties of it.
DataNavigateUrlFields - This can be a comma separated list of the fields from the GridView's table that you want to send into the Url.
DataNavigateUrlFormatString - This is the URL. It works like String.Format() where you put in the placeholders for the fields from DataNavigateUrlFields to go into.
E.g. "myurl.aspx?id={0}&id2={1}"
MSDN Link
Posted by elberon5
Thu, 13 Sep 2007 20:31:00 GMT
After much frustration i think i've solved the issues i've been having with getting something to fit perfectly in a browser window. I use this for map APIs so they take up the entire screen.
AFAIK this works in FF and IE. I don't respect the other browsers yet but feel free to post in the comments if it works there too.
<style in css file>
body, html
{
margin:0px;
padding:0px;
width:100%;
height:100%;
}
</style>
<div style="
position:absolute;
top:0px;
left:0px;
height:100%;
width:100%;
background-color:#C0C0C0;
">
.....
</div>
no comments
Posted by elberon5
Wed, 08 Aug 2007 13:21:00 GMT
This
article
has links to all you need to get started with bittorrent.
no comments
Posted by elberon5
Fri, 20 Jul 2007 14:33:00 GMT
Ok. Yet another cool trick that Visual Studio 2005 can do. Automatically make all the cases in a switch using an enumerator.
E.g.
public enum DMS
{
Degrees,
Minutes,
Seconds,
Direction
}
Ok. Now the cool part. Hit Ctrl-K, Ctrl-X, then select switch and type dms, enter. and BAM! you have this automatically written for you.
switch (dms)
{
case DMS.Degrees:
break;
case DMS.Minutes:
break;
case DMS.Seconds:
break;
case DMS.Direction:
break;
default:
break;
}
Enjoy!
no comments
Posted by elberon5
Fri, 29 Jun 2007 14:51:27 GMT
I found this today randomly.
dofactory shortcut keys for VS.NET
My favorite so far is CTRL + ]
no comments
Posted by elberon5
Wed, 27 Jun 2007 16:06:00 GMT
It's been awhile, so here's some new shortcut keys for visual studio.net i've recently discovered.
If you type if, or another keyword that visual studio has a snippet or intellisense for you can hit [tab] twice and it will throw in the remainder of the snippet for you and launch you into the snippet. E.g. Type 'switch ' then tab tab.
Ctrl+Shift+V - This is like paste except visual studio attempts to autoformat the text into the correct tab layout for you. This is for use in the HTML editor. I'm not sure if it works in the code behind.
Enjoy
no comments
Posted by elberon5
Fri, 27 Apr 2007 20:12:00 GMT
I haven't played with this too much, but this is a neat thing I didn't know C# did.
string foo = foo1 ?? foo2 ?? "N/A";
2 comments
Posted by elberon5
Fri, 20 Apr 2007 13:55:00 GMT
I've been using snippets since I started using Visual Studio 2005. This is one of the best features of the IDE. Aside from all the built-in snippets you can write your own. For some reason I felt compelled to share this with the few readers I have of this blog. Uh. Who am I kidding, I mean with myself. The only reason I have this blog is to look back later and remember what I did.
Here's one I wrote that I use over and over again. It's for Event Handlers. Any recommendations on how to improve this one would be greatly appreciated. Copy the code below and save into a .snippet file in your My Docs/VS2k5/Code Snippets folder. Then when you're in VS2k5 hit Ctrl+K, Ctrl+X. Enjoy.
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0" >
<Header>
<Title>EventHandler</Title>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>MethodName</ID>
<Default>MethodName</Default>
</Literal>
<Literal Editable="true">
<ID>Body</ID>
<Default></Default>
</Literal>
</Declarations>
<Code Language="CSharp">
protected void $MethodName$(object sender, EventArgs e)
{
$Body$
}
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Another favorite snippet of mine is the built in switch. For some reason, going between several languages always confuses me on the syntax of these.
1 comment
Posted by elberon5
Tue, 03 Apr 2007 15:42:00 GMT
This is for Visual Studio.Net 2005
Ctrl+I - Incremental Search.
It's nice because it doesn't launch the search window. You hit it then start typing and it goes to the next occurance of what you are typing. It's kinda like an emacs search. Hit Ctrl+I to pop to the next occurance or ESC to get out of it.
1 comment