Stuffing a Javascript Value into a VBScript Variable
Detect the client’s screen resolution using Javascript and then stuff it into an ASP variable!
Detect the client’s screen resolution using Javascript and then stuff it into an ASP variable!
‘ Return the absolute Url of a secured page (that uses the https protocol)’ The input string is the page’s relative path’ Example: Dim url As String = GetSecuredPageUrl(“./Admin/Login.aspx”)Function GetAbsoluteSecuredPageUrl(ByVal
‘ Return the value of the specified custom key, stored in the Web.Config file.’ If the value has been already requested before, the function returns its ‘ cached value.’ The
‘ Output an image as a binary stream to the Response objectSub ShowImage(ByVal bmp As Bitmap) ‘ Clear current content and set returned content type HttpContext.Current.Response.Clear() HttpContext.Current.Response.ContentType = “image/jpeg” ‘
‘ Convert a string to its ASCII representation’ Example: Response.Write(AsciiEncode(“hello”))’ ==> hello” Note: this may be useful when you’re producing the code for HTML forms with ‘ hidden/visible field, and
‘ A custom routine that works like FormsAuthentication.RedirectFromLoginPage ‘ but lets you control the authentication cookie’s expiration date’ Example: create an auth cookie that lasts 7 days’ RedirectFromLoginPageEx(username, persistent, 7)Function
If you develop a custom control and want to give the option to output client-side javascript code, you’ll likely have a EnableClientScript that allows the developer to specify whether the
Sometimes it is very helpful to use a JavaScript feature that supports adding properties to build-in prototype “Objects” at runtime. It is generally known that Netscape 4.x has problems in
Say you have a column in a SQL Server table that allows NULL values. You want this column to be unique when it has a value other than NULL. What’s