Welcome To Snipplr
Everyone's Recent VB.NET Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Esta función devuelve un string aleatoreo con un largo aleatoreo, con un mÃnimo y un máximo.
El uso más común es solo especificar el largo máximo.
Especialmente útil para pruebas unitarias.
NOTA: depende de http://snipplr.com/view/14580/n...
1
661
posted 15 years ago by delm
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
725
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
796
posted 15 years ago by blackf0rk
Convert hexidecimal color codes (ie #C0C0C0) to decimal RGB (ie 255,255,255)
0
1013
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
761
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
848
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
1064
posted 15 years ago by blackf0rk
Assuming your DataSet (named, ds) is already populated with Data and contains only one table.
0
1429
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
1273
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
994
posted 15 years ago by blackf0rk
If you need to get the HTML from a Web page to rip it, process it, and/or display it in the way you want, the following function will work for you.
0
1028
posted 15 years ago by blackf0rk
This function will parse out the Google Maps coordinates from a Google Maps link url like this one: http://maps.google.com/?ie=UTF8&ll=43.068888,-87.978516&spn=23.565589,33.925781&t=h&z=5. The coordinates in this URL are 43.068888,-87.978516.
0
1047
posted 15 years ago by blackf0rk
Serializes any <serializable/> object and writes it to the specified location on the disk.
Example:
Dim obj As DataTable
'save obj to disk
SerializeToFile(filepath, obj)
'to read it back, use DirectCast
Dim obj2 As DataTable = DirectCast(...
0
996
posted 15 years ago by chavcho
Use this to extract an image embedded as a resource in your project. Call the function supplying the full path to the resource, for example:
Dim myImage as Bitmap = EmbeddedIcon("MyApplication1.myImage.png")
Where "MyApplication1" is the root n...
0
966
posted 15 years ago by chavcho
This is modified from code found here: http://www.meadinkent.co.uk/XLexport-text1.htm and here: http://www.meadinkent.co.uk/XLexport-text2.htm
0
813
posted 15 years ago by BlueCockatoo
Uses a regular expression to validate a string as a validly formatted email address.
1
901
posted 16 years ago by Anthony
Gets a ClientScriptManager reference from the Page class. If the client script is not already registered on the page, builds and registers a script. Useful for building a script dynamically and ensuring that it gets registered during the correct s...
1
772
posted 16 years ago by Anthony
Usage of Server, Response and Request object with HttpContext declaration from external class
0
766
posted 17 years ago by miziomon