When you run Internet Explorer in full screen mode, the Internet Explorer title bar, menus, toolbars, and status bar are not displayed and Internet Explorer runs in Full Screen mode. The Windows taskbar is not displayed, but you can switch to other running programs by pressing ALT+TAB or CTRL+ALT+DEL. This mode is known as Kiosk mode.
We can implement this by making configuration changes in window.open method of javascript.
Here is the sample logic:
window.open("sample.html","newwindow","fullscreen")
Saturday, October 4, 2008
Monday, September 15, 2008
Browser detection in ASP
By using Request.ServerVariables("HTTP_USER_AGENT"), we can write a logic to implement this.
Request.ServerVariables("HTTP_USER_AGENT") will result in the following:
For IE:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
For Firefox:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
Based on above, we can write below logic.
varBrowser= Request.ServerVariables("HTTP_USER_AGENT")
If InStr(varBrowser, "MSIE") > 0 Then
BrowserType = "IE"
Elseif InStr(varBrowser, "Firefox") > 0 Then
BrowserType = "FireFox"
End if
Request.ServerVariables("HTTP_USER_AGENT") will result in the following:
For IE:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
For Firefox:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
Based on above, we can write below logic.
varBrowser= Request.ServerVariables("HTTP_USER_AGENT")
If InStr(varBrowser, "MSIE") > 0 Then
BrowserType = "IE"
Elseif InStr(varBrowser, "Firefox") > 0 Then
BrowserType = "FireFox"
End if
Saturday, September 13, 2008
Recordset GetString() method
The GetString method returns the specified Recordset as a string.
This method can be used to fill HTML tables in ASP files.
You can find the details of the method in the below link:
http://www.w3schools.com/ADO/met_rs_getstring.asp
This method can be used to fill HTML tables in ASP files.
You can find the details of the method in the below link:
http://www.w3schools.com/ADO/met_rs_getstring.asp
Saturday, June 14, 2008
Generate HTML dynamically in javascript
Place a div tag in then body of the html where you the dynamic html to be displayed
Suppose you want a textbox control to be added each time in an on click event of a hyper link,
Onclick javascript function:
You can use this logic according to your requirements.
Suppose you want a textbox control to be added each time in an on click event of a hyper link,
Onclick javascript function:
You can use this logic according to your requirements.
Friday, June 13, 2008
To check and uncheck a radio button
Code to check and uncheck a radio button,
Logic 1:
Add below code to the control
onclick='this.chk = this.chk ? this.checked = !this.chk : this.checked'
OR
Explanation:
A property by name "chk" is created to "this" object and is assigned the value of standard "checked". It stores the current state of the radio button. Based on this we check and uncheck the radio button. (You can use any name in place of "chk")
Logic 2:
Explanation:
Declare a global variable and set it to null initially. Call this function in the radio button control onclick event and pass "this" as parameter. When radio button is checked for first time, the if condition is true and hence it is checked. The global variable's value is now changed. Now when you check the radio button, if condition is false and hence else part is executed where radio button checked property is set to false. Here, global variable's value is again changed. This way, the radio button gets checked and unchecked alternatively.
Logic 1:
Add below code to the control
onclick='this.chk = this.chk ? this.checked = !this.chk : this.checked'
OR
Explanation:
A property by name "chk" is created to "this" object and is assigned the value of standard "checked". It stores the current state of the radio button. Based on this we check and uncheck the radio button. (You can use any name in place of "chk")
Logic 2:
Explanation:
Declare a global variable and set it to null initially. Call this function in the radio button control onclick event and pass "this" as parameter. When radio button is checked for first time, the if condition is true and hence it is checked. The global variable's value is now changed. Now when you check the radio button, if condition is false and hence else part is executed where radio button checked property is set to false. Here, global variable's value is again changed. This way, the radio button gets checked and unchecked alternatively.
Tuesday, May 27, 2008
Paging in ASP
//Execute the query and open the recordset
Rs.Open sql,Conn,3,1 //here 3 is cursor type and 1 is lock type. cursor type is static and lock type is readonly
If not(Rs.eof and Rs.bof) then
//initialize paging requirements
Pagesize = 5 //set page size to a variable
Page = request(“page”) //get the current page no into a variable
If Page = “” then Page = 1 //if this variable is null that means it is first page
Recordcount = Rs.recordcount //get no. of records in Rs
Rs.pagesize = Pagesize //assign page size to Rs
Rs.absolutepage = Page //current page no. assigned to Rs
TotalPages = Rs.Pagecount //get count of total no. of pages
Prev = Page – 1 //Previous page no. set here
Next = Page + 1 //Next page no. set here
Count = 1 //initialize count variable to 1
//open the while loop of the result set
While not Rs.eof and Count <= Pagesize //Here, looping is restricted to the page size that we have set
………………………..
//increment count variable
Count = Count + 1
//close loopWend
//At the bottom of the page, provide links for paging
Rs.Open sql,Conn,3,1 //here 3 is cursor type and 1 is lock type. cursor type is static and lock type is readonly
If not(Rs.eof and Rs.bof) then
//initialize paging requirements
Pagesize = 5 //set page size to a variable
Page = request(“page”) //get the current page no into a variable
If Page = “” then Page = 1 //if this variable is null that means it is first page
Recordcount = Rs.recordcount //get no. of records in Rs
Rs.pagesize = Pagesize //assign page size to Rs
Rs.absolutepage = Page //current page no. assigned to Rs
TotalPages = Rs.Pagecount //get count of total no. of pages
Prev = Page – 1 //Previous page no. set here
Next = Page + 1 //Next page no. set here
Count = 1 //initialize count variable to 1
//open the while loop of the result set
While not Rs.eof and Count <= Pagesize //Here, looping is restricted to the page size that we have set
………………………..
//increment count variable
Count = Count + 1
//close loopWend
//At the bottom of the page, provide links for paging
Print a page
//Give the link in the html page to print

//Put the div tags with class=”noprint” in the page wherever required
//On clicking, the entire page is printed
How to eliminate the unnecessary things from printing?
// Declare the style in a style sheet
.noprint
{
DISPLAY: none
}
//include the external style sheet in the page
How to eliminate the unnecessary things from printing?
// Declare the style in a style sheet
.noprint
{
DISPLAY: none
}
//include the external style sheet in the page
//Put the div tags with class=”noprint” in the page wherever required
Subscribe to:
Posts (Atom)