Profile
Achievement
blackf0rk's Recent Snippets
- All /
This code will take a start and end string and then search for them within the subject string. It returns what is between the start and end strings. As an example, if I had the following text...
Some test text string, with a start <tag> and an end...
0
1011
posted 14 years ago by blackf0rk
An important thing to keep in mind about adding groups is that you add groups to site collections and not webs. To do this, we access the SiteGroups collection rather than the Groups collection.
In order to assign permissions, each group you add n...
0
999
posted 15 years ago by blackf0rk
This will delete all items in a SharePoint list. Better than looping through a SPListItemCollection and doing a .delete();
0
1103
posted 15 years ago by blackf0rk
In order for the code snippet(s) to work, you need to do the following:
1. Go download the EWS API SDK: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c3342fb3-fbcc-4127-becf-872c746840e1
2. Install the SDK on your machin...
0
949
posted 15 years ago by blackf0rk
In order to accurately get the next ID from a SharePoint list you need to access the content database for one reason: If you delete all the items from a list, and execute this simple code: list.Items[list.ItemCount -1].ID) + 1 the ID will always retu...
0
915
posted 15 years ago by blackf0rk
Use inType=0 and feed in a specific Google Maps URL to parse out the GeoCoords from the URL
e.g. http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=53154&sll=37.0625,-95.677068&sspn=52.505328,80.507812&ie=UTF8&ll=42.858224,-88.000832&spn=0....
4
2637
posted 15 years ago by blackf0rk
This is a simple function to test for an internet connection. Originally grabbed from "devbuzz" at the devbuzz forums (see link) and now modified for VB.NET 3.5
0
1289
posted 15 years ago by blackf0rk
This will return a list of all the tables in a certain database along with their row count.
1
914
posted 15 years ago by blackf0rk
This command will fix the “The list is too large to save as a template. The size of a template cannot exceed 10485760 bytes." error when saving a list (including content) that's too big.
0
824
posted 15 years ago by blackf0rk
If you want to have a JavaScript confirmation alert to popup before executing the codebehind (e.g. asking the user if they really want to delete a record):
1
755
posted 15 years ago by blackf0rk
If you need to get the DataKey value in RowDataBound (e.g. Assigning the DataKey to the CommandArgument of a button):
0
818
posted 15 years ago by blackf0rk
Convert hexidecimal color codes (ie #C0C0C0) to decimal RGB (ie 255,255,255)
0
1042
posted 15 years ago by blackf0rk
If you have a component being bound from an ObjectDataSource (like a drop-down menu, or a grid view) and you wish to change the value's SelectParameters. Where # is which SelectParameter you'd like to change. If there's just one SelectParamter, defau...
0
786
posted 15 years ago by blackf0rk
Dynamically change the content of meta tags from the code behind. This allows you to feed the meta tags with content from a database or other dynamic content.
0
867
posted 15 years ago by blackf0rk
Sometimes you want to return a bunch of data from a table, but you want it coming back in a random order. Maybe it's for keeping some content on a home page fresh. Here's how:
0
753
posted 15 years ago by blackf0rk
If you're going to be using a common function throughout the Web site, you can include the function in your MasterPage and gain access to it from each aspx that inherits from this MasterPage; like so:
0
1086
posted 15 years ago by blackf0rk
Validating a decimal such as a measurement of time or currency (10.5 or 0.4). This function will return the correct number. If you feed in "10.5foo" the function will spit back 10.5. If you feed in "bar" the function will return nothing.
0
704
posted 15 years ago by blackf0rk
Assuming your DataSet (named, ds) is already populated with Data and contains only one table.
0
1456
posted 15 years ago by blackf0rk
It's important that the newPn var that you pass into the Convert.ToInt64 function is in the xxxxxxxxxx format and that no characters are present.
1
1296
posted 15 years ago by blackf0rk
Passing in a seed and your string will return an encrypted string. Pass in the same seed and the encrypted string again and it will return the original unencrypted string.
1
1017
posted 15 years ago by blackf0rk