Link taken form microsoft, the article describes the methods to Implement Role-Based Security with Forms-Based Authentication in Your ASP.NET Application by Using Visual C# .NET

window.Open Function
———————————-

The window.open() function allows us to control the way a new window is opened, you can choose to have the toolbar, the address bar or even have a fixed dialog window which cannot be resized.

All these are controlled based on the parameters passed to the open method, lets look at each one of them.

*************************************************************
The “LINKS” or “EXTRAS” toolbar.
window.open(“page1.htm”,”width=400,height=300,directories=yes”);

The address or URL toolbar.
window.open(“page1.htm”,”width=400,height=300,location=yes”);

The toolbar with FILE, EDIT, VIEW, etc….
window.open(“page1.htm”,”width=400,height=300,menubar=yes”);

Allows the visitor to be able to resize the new window or not.
window.open(“page1.htm”,”width=400,height=300,resizable=yes”);

Forces vertical scrollbars to appear or not. Rarely used property.
window.open(“page1.htm”,”width=400,height=300,scrollbars=yes”);

The status bar along the bottom of the browser window.
window.open(“page1.htm”,”width=400,height=300,status=yes”);

The toolbar with BACK, FORWARD, REFRESH, etc…
window.open(“page1.htm”,”width=400,height=300,toolbar=yes”);

The height n width of the new window in pixels.
window.open(“page1.htm”,”width=400,height=300″);
*************************************************************

All the above parameters can be clubbed together to get a window of our choice.
Specifying only the WIDTH and HEIGHT options will automatically set the other properties to “no”. Only the title bar holding the minimize/maximize buttons will be displayed on the window. To get the other settings to show, they will have to be specfied as “yes” explicitly.

window.close Function
———————————-

To close the current window just say
window.close()

But how do i close the child window by clicking a button on the parent window.
Provide a name for the child window when you open it
Ex: window.open(“URL”,”Name”,”parameters”);
window.open(“page1.aspx”,”MyExamle”,”parameters”);

Now you have to call the close method on the window name like this
Ex: MyExample.close();

Now by using the Name property you can use all the object available for the window object and manipulate the child window.

The example below changes the Url of the child window to show a new url.
Ex: MyExample.location.href(“Webform2.aspx”)

Hope this section provided you with some basic information on using the Open and close methods of the window object in Javascript and how to manipulate child window views.

There are many a time when you might want to open a child window for showing a calendar and returning the selected value to the parent form text box,

Here’s how to do it using JavaScript.

Open the HTML view of the child form, include this as a javascript function and call it on Unload of the child form or on button click.

window.opener.document.getElementById(‘txtParent’).value = window.document.getElementById(‘txtChild’).value

In the parent form you can open the child window by using window.open in the Response.Write method.
Check out my other post on the using the window.open parameters.

19
Apr

Need a Block Menu in CSS?….its right here…..

   Posted by: Kannan V   in Uncategorized

Need a block menu fast!
Below are simple CSS menu designs for you to download and use any way you see fit.
You can download the complete set, or an individual menu by clicking the Download Menu button located on each menu.
Thanks to Veerle for the tutorial on the menu design 3, the best looking menu here.
Please feel free to download for commercial or private use, and modify to suit your needs.
Creative Commons – Attribution 2.0 – designed by Ian Main – e-lusion.com

A good presentation on using XMLHTTP…………….
Click on the link above to read on………………

http://www.kbalertz.com/Feedback_893659.aspx

There was heated exchange of mails in our company’s internal knowledge Bulletin board.
One of my colleague was not able to make her ASP.net web app to run properly.

The SQL server 2000 Server IP address was changed, and after that the ASP.net application does not run.
The app runs fine if impersonated with the line identity impersonate =true is added to the web.config file, which was not the case before.

What might be the reason for this, after a long list of mails finally got the solution from a fellow employee in China…….

*********The Solution***********

The problem is caused by the IP address modification. Please follow the steps to locate the reason:
1. Login to the server where the SQL Server is deployed.

2. Execute SqlDiag.exe to gather information of the SQL Server.
By default, the SqlDiag.exe is under: C:\Program Files\Microsoft SQL Server\MSSQL\binn3. Open the log file generated by the SqlDiag.exe, check the IP address the SQL Server instance is listening.

By default there are three lines which are related with the IP address the SQL Server listen to. For example:

2005-03-30 14:38:36.65 server SQL server listening on 172.21.240.84: 1433.
2005-03-30 14:38:36.65 server SQL server listening on 127.0.0.1: 1433.
2005-03-30 14:38:36.68 server SQL server listening on TCP, Shared Memory, Named Pipes.

In above example, the first line is the IP address of the Server, the second is the lookback ip address, and these two are used to support TCP/IP connection to SQL Server. The third is for named pipeline protocol, which is defaulted enabled.

4. For your problem, mostly is because the SQL Server is still listening to the old IP address. Because the IP address has been changed, and SQL Server’s configuration is not changed, the client can not connect to SQL Server via TCP/IP protocol anymore.

5. If the problem can be located in step 4, the reason that why does the SQL Server can be connected while the “” is configured will be clear.
It’s because that the client application first selects TCP/IP to connect to the SQL Server.
If it is failed, the client application will try to use named pipeline. For named pipeline, it requires authentication before connecting. So, without the line in the Web.Config file, the link via named pipeline can not be established.
So, the client can not access SQL Server

Finally the fight is over……………………

12
Apr

Using XMLHTTP in Javascript

   Posted by: Kannan V   in Uncategorized

Stumbled upon a cool posting on using XMLHTTP with javascript, the example posts a code to populate a dropdown list based on the value selected on another.

There have been a lot of Questions on releasing the COM objects when using Office applications with web apps.
Above is a link to a site that explains how to gracefully clean up the objects.

Also check out this link at the MS site.
http://support.microsoft.com/?kbid=317109

Article Url:
http://www.dotnetinterop.com/faq/?q=OfficeCleanup

You may receive an “Access is denied” error message when you try to debug a Web application, and you have administrative permissions in Visual Studio .NET
Article ID
:
894433
Last Review
:
March 25, 2005
Revision
:
2.0
On this page

SYMPTOMS

CAUSE

RESOLUTION


MORE INFORMATION


REFERENCES
SYMPTOMS
You may receive the following error message when you try to debug a Web application:
Access is DeniedThe problem occurs when the following conditions are true:

You are logged on to your computer with administrative permissions.

You are debugging a Web application in Microsoft Visual Studio .NET.

The operating system that you are using is Microsoft Windows XP Service Pack 2.

The Microsoft ASP.NET worker process account is not a member of the Administrators group.
CAUSE
The problem occurs because the ASP.NET worker process does not have the Impersonate a client after authentication user right. If the worker process account does not have this right, the debugger cannot attach to the process. The worker process account is configured by using the processModel element in the Machine.config file.
RESOLUTION
To give the worker process account the Impersonate a client after authentication user right, follow these steps:
1.
Click Start, point to Settings, and then click Control Panel.
2.
Double-click Administrative Tools.
3.
Double-click Local Security Policy.
4.
Expand Security Setting, expand Local Policies, and then click User Rights Assignment.
5.
In the Policy pane, right-click Impersonate a client after authentication, and then click Properties.
6.
Click Add User or Group.
7.
Add the worker process account that is configured in the processModel element in the Machine.config file.
8.
Click OK two times.
9.
Click Start, click Run, type iisreset, and then click OK.
10.
At a command prompt, type the following command to refresh policies on the computer:
gpupdate /forceMORE INFORMATION
Steps to reproduce the problem
1.
Open the Machine.config file. Locate the processModel element.
2.
Replace the username attribute and the password attribute as a non-administrative user.
3.
Restart Internet Information Services (IIS).
4.
Log off your computer. Log on your computer so that you have administrative permissions.
5.
Start Visual Studio .NET.
6.
Create a new Web application.When you try to debug the Web application, you may receive the following error message:
Error while trying to run project: Unable to start debugging on the web server. Access is denied.REFERENCESFor more information about developing software in Visual Studio .NET that has non-administrative permissions, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/tchDevelopingSoftwareInVisualStudioNETWithNon-AdministrativePrivileges.asp

16
Mar

Code to Open an IE Window from a Windows Form in C#

   Posted by: Kannan V   in Uncategorized

Process p = new Process();
p.StartInfo.FileName = “iexplore.exe”;
p.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
p.StartInfo.Arguments = www.google.com
p.Start();

Page 20 of 25« First...101819202122...Last »