Welcome To Snipplr


Everyone's Recent VB.NET Snippets



1 2 3 Next »
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 359 posted 13 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 393 posted 13 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 452 posted 13 years ago by blackf0rk
Convert hexidecimal color codes (ie #C0C0C0) to decimal RGB (ie 255,255,255)
0 631 posted 13 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 409 posted 13 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 497 posted 13 years ago by blackf0rk
2 3272 posted 13 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 649 posted 13 years ago by blackf0rk
Assuming your DataSet (named, ds) is already populated with Data and contains only one table.
0 965 posted 13 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 739 posted 13 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 527 posted 13 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 606 posted 13 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 632 posted 13 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 600 posted 13 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 524 posted 13 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 492 posted 13 years ago by BlueCockatoo
1 639 posted 14 years ago by DaveChild
Uses a regular expression to validate a string as a validly formatted email address.
1 506 posted 14 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 433 posted 14 years ago by Anthony
Usage of Server, Response and Request object with HttpContext declaration from external class
0 419 posted 15 years ago by miziomon
1 2 3 Next »