IE 9.0 + Webpage has expired while clicking on Submit button:

This is not related with internet explorer back button.

I have created a website and tested it with IE 6.0, 7.0 and 8.0. Its working fine in all these browsers. After some time, microsoft came with newer version internet explorer 9.0. So I have tested the same in IE 9.0. However its not working fine in IE 9.0. Most of the time when I am submitting my page, its working fine, however sometimes its displaying error “Webpage has expired”. I have tried to find the solution on various search engines. However could not got solution. Then I have tried in IE 9.0 with developer toolbar and updated its with “Browser Mode: IE9 and Document Mode: IE9 Standard ” and tested the same page by clicking on submit button. I have tested this many times and its working fine. I have made following changes in the web page:

I have updated <DOCTYPE > tag as following:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”>

I have also added following tag in <head> tag.
<meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE9″>

After spending sometime on resolving this issue, I have thought to post this on web, so that others can resolve this type of issue easily.

Posted in ASP.Net | Leave a comment

Sample Application: InstallScript MSI

Introduction

InstallShield allows creating windows setup. It allows creating custom setup using components and features. It allows customizing UI flow, installing logic and customizing UI theme for the setup.

How to create InstallShield project?

To create New InstallShield project, open InstallShield 2011 and select File menu → new. It will open new project dialog.

Select Windows Installer tab. Select InstallScript MSI project. Specify the project name and location of the project on the disk. Click OK. It will create TestProject and show you Project Assistant window.

The project assistant allows you to configure settings as I have highlighted in the image. Click on Application Information to configure application information for the project.

Application Information:

The application information will allow you to set basic information for the setup. It includes company name, application name, application version and company web address. It also allows specifying setup icon.

Now click on Application Requirement. The application requirement tab allows configuring dependencies of the application. It allows selecting OS dependencies and software dependencies of your application.

If your application has any OS dependencies then select Yes in first box and select required Operating Systems from the box under it.

If your application has any software dependencies then select Yes in Second box. Then select the software dependencies of your application below it.

Now click on Installation Architecture tab. It will allow you customize your application with customized architecture.

Now Click on Application Files. It allows specifying files you would like to put on destination machine. It also allows using special folders of Operating System.

The Application tab allows you to configure files you would like to add into the install. It allows you to change the location of your application on the target machine. By default, it installs the application in ProgramFiles\<CompanyName>\<ApplicationName>. You can change it according to requirement. You can add files to folder by clicking Add Files and select the files you would like to include in setup.

If you need any special folder (e.g. Fonts folder) then right click on Destination Computer and hover to Show predefined folder. It will show all predefined folders of Operating System. Then select the folder you would like to show.

For example, if your application needs additional fonts and you would like to add those fonts to destination machine then select Fonts folder and add the font files to that folder.

You can configure location of specific feature. To configure location of the feature, select the feature from All Application data drop down and configure it as required.

Now click on Installation Designer to design your setup. The installation designer allows you to customize and configure setup for your application.

In above image, select the General Information under Installation information in the left pane. It will show you general properties of the setup project shorted by category by default. You can change sort order to alphabetically.


There are 3 categories for General information properties. 1) General 2) Summary Information Stream 3) Add or Remove Programs.

The General categories show basic properties used for the project.

Project file Name: It is read only property. It shows the full path of the install shield project.

Project File Format: it defines format of the project file. It could be Binary (default) or XML.

Setup Language: It defines setup language for the user. You can select multiple languages.

Default Language: Specifies default language from the selected languages.

Enable Maintenance: It specifies that application allows you to modify features after the install or not? If yes then the user can modify features from control panel.

Product Name: Specifies Name of the product. You can identify the product in add/remove programs using the same product name.

Product Version: Version of the product.

INSTALLDIR: Specifies installation directory where the application will be installed. For eg. [ProgramFilesFolder]TestCompany\TestProject. The [ProgramFilesFolder] will be replaced by ProgramFilesFolder path of the operating system.

The summary information category allows you to specify following properties.

Author: Author of the setup.

Keywords: List of keywords separated by comma for the setup.

Template Summary: It specifies the supporting processor type and default language of the setup. It accepts value like Intel; 1033. The Intel specifies x86 processor and the 1033 specifies English language. Valid processor values includes

ñ Alpha (Alpha is supported by Windows Installer 1.0 only.)

ñ Intel

ñ Intel64 (Intel64 is supported by Windows Installer 2.0 only.)

ñ x64

The Add or Remove Programs category properties allow you specify options available in add/remove programs after installation.

Display Icon: Specifies icon file that will be displayed in add/remove programs when you installs the application.

Disable Change button: Specifies that user will have an option to change the features of the application in add/remove programs.

Disable Remove button: Specifies that user will have an option to remove the application in add/remove programs.

Publisher: Publisher of the application

Publisher URL: Publisher web address.

There are two main perspectives in an installation project—that of the developer and that of the end user. In InstallShield, these perspectives are addressed in detail in the Components and Features views, respectively.

Components:

Components represent the developer’s view of the product. They are installation authoring tools that help the developer organize similar application data—such as files, registry entries, and shortcuts—into logical groups.

To enable the end user to choose which features to install, you should divide your application into components that correspond with the features of your application.

Features:

Features are the building blocks of an application from the end user’s perspective. Each feature represents a specific piece of functionality for your product—such as the help files. End users should be able to install and uninstall discrete features of your product.

For example, an end user with limited hard drive space could elect not to install a product tutorial. If the user subsequently purchases another computer or frees resources on an existing one, the previously uninstalled product tutorial could then be installed.

You should separate your application into features that correspond to the components of your application.

To define components of setup, select Components under Organizationfolder in installation designer.

By default, the setup has Default Component. You can add additional components in the system.

For example, if my application has two modules, 1) Client 2) Admin. In that case, I can add 3 components 1) Client 2) Admin and 3) Shared.

Client component will hold files, registry settings and short cuts for the client components.

To add new component, right click on Components and select New Component. It will add new component to components list. Rename the component and name it to Client.

Now expand the client component. A component will have 4 child nodes.

Select the Files node. It will show you files content pane. To add files to the component, right click on content pane and select Add… Select the files you would like to include for the component. The files might be an executable, a dependent assemblies etc.

To include registry settings for specific components, select Registry Data. It will show you source and destination computer registry. You can configure registry settings for the components. If the client component requires and registry setting, you can create required registry settings.

For example, if you would like to add key named “Client” under HKEY_LOCAL_MACHINE\Software then right click on HKLM and select New → Key and key name “Software”. Now right click on Software and select New → Key and specify key name “Client”. Now you can add any settings under client key.

In Shortcuts, you can add required shortcuts for the components.

Same way, you can create Admin & Shared components. The shared components will hold all the files those are used in both components.

Now select Features under Organization in installation designer. By default, Setup has DefaultFeatureadded. So you can remove the feature and add features according to your requirements.

For example, if your application has two features 1) Admin 2) Client then creates two features named Admin and Client and change its Display Name accordingly. The display name property specify the name of feature displayed to the user while installation.

Now you need to assign components to the feature. So it will installs components assigned to the features selected by the user.

To assign components to feature, select Setup Design under Organizationin installation designer.

In setup design, select the feature you would like to assign components. Right click the feature and select “Associate Components”. It will show associate components dialog with list of available components. Select components you would like to associate with the feature. You can select multiple components using Ctrl key. Click Ok to associate components with the feature.

In my example, I have added 2 features and associated 2 components.

In my example, I have added 2 features with 2 associated components with them. In Admin feature, I have associated Admin and Default component. In Client feature, I have associated Client and Default component.

InstallShield also allows you to show custom dialog during setup process. To create new dialog, select Dialogs under User Interfacein installation designer.

It will show available dialogs in InstallShield. You can also create custom dialogs.

To create custom dialog, right click on All Dialogs and select New Dialog. It will add new dialog to dialog list. Rename the dialog as required. To edit the dialog, select the dialog and click Edit Dialog.

It will show the dialog design and edit. You can put new controls using the toolbar.

This toolbar will automatically show up when you click edit dialog.

Now, if you would like to customize control of the setup then you need to create installscript. The InstallScript is same like VBScript. To open InstallScript, select InstallScript under Behavior and Logic in installation designer. It will open the installscript. By default, it shows default setup.rulinstallscript file. You may add multiple files as required.

I have added registration.rul for registration purpose.

All the functions used in script will be displayed under Functions node.

Setup.rul

//===========================================================================

//

// File Name: Setup.rul

//

// Description: Blank setup main script file

//

// Comments: Blank setup is an empty setup project. If you want to

// create a new project via. step-by step instructions use the

// Project Assistant.

//

//===========================================================================

// Included header files —————————————————-

#include “ifx.h”

#include “Registration.rul” //Include Registration.rul file

// Note: In order to have your InstallScript function executed as a custom

// action by the Windows Installer, it must be prototyped as an

// entry-point function.

// The keyword export identifies MyFunction() as an entry-point function.

// The argument it accepts must be a handle to the Installer database.

/* export prototype MyFunction(HWND); */

//—————————————————————————

// OnMoved

//

// The OnMoved event is called just before the InstallShield action

// ‘GeneratedMSIScript’ is executed.

//—————————————————————————

function OnMoved() //Executed when file process progress completed.

// Declaration

NUMBER nResult, szReturn;

STRING szDllName, szClass;

OBJECT objLicensing;

begin

if (!MAINTENANCE) then

// non-maintenance code

//Use external DLL.

szDllName= SUPPORTDIR ^ “TestSecurityHelper.dll”;

szReturn=UseDLL(szDllName);

if (szReturn <0 ) then

MessageBox(“Failed to load dll.”, SEVERE);

endif;

//Class name to use.

szClass=”TestSecurityHelper.TestLicensing”;

try

//create object of TestLicensing.

set objLicensing= DotNetCoCreateObject(szDllName,szClass,””);

MessageBox(“Licensing object created”,INFORMATION);

if(!objLicensing.IsRegistered()) then

objLicensing.CreateRequiredRegistry();

nResult=Registration();

endif;

catch

MessageBox(“Error using custom DLL”, SEVERE);

endcatch;

endif;

end;

//—————————————————————————

// OnFilterComponents

//

// The OnFilterComponents event is called by the framework to filter out

// components in each feature by language and platform, override this

// event to perform custom filtering.

//

// Note: This event will not be called automatically in a

// program…endprogram style setup.

//—————————————————————————

function OnFilterComponents()

number nResult;

string szInstall;

begin

// Filter file groups by current platform.

FeatureFilterOS(MEDIA, 0, ISOSL_ALL, TRUE);

FeatureFilterOS(MEDIA, 0, SYSINFO.nISOSL, FALSE);

// Filter file groups by current language.

FeatureFilterLanguage(MEDIA, ISLANG_ALL, TRUE);

FeatureFilterLanguage(MEDIA, STANDARD_SELECTED_LANGUAGE, FALSE);

end;

Registration.rul

Note: This application is created for reference only. May be some functionality cannot work in your solution. Its not our responsibility if any written feature/code not working with your solution.

Specially Thanks: Bhavesh S.

Posted in Setup and Deployment | 3 Comments

SQL Server : Generating user instances in SQL Server is disabled. User sp_configure ‘user instances enabled’ to generate user instances.

To resolve this issue, please follow the following steps:

1. Start the SQL Server 2005 Management Studio Express.
2. Connect to the default instance of that server (Your Machine Name\SQLEXPRESS)
3. Then open a New Query Window. Please check that you are connecting to the master database
4. Type: exec sp_configure ‘user instances enabled’, 1
5. Type: RECONFIGURE
6. Restart the SQL Server

Hope, this will resolve this issue.

Posted in BizTalk Server | Leave a comment

WINDOW 7 + The installer has encountered an unexpected error installing this package. Error code is 2869

I have faced this error while installing SubSonic(http://www.codeproject.com/KB/database/SubSonic.aspx) in my machine. I have searched on google and found the solution. This is a security issue with the Window 7.

To resolve this issue please open Command Prompt by right and ran as Administor. The move to the installer’s directory.  Then run following command on command prompt:

your_InstallerName.msi

This will successfully install the installer. :)

Posted in ASP.Net, ASP.Net | 3 Comments

Session sharing issue in various Tabs in Internet Explorer

One of the common problems reported with tabbed browsing in Internet Explorer is that the session state is shared between the tabs. Due to this user can face many issues like 1> Suppose user has opened a Product(productID=2) and editing it in one tab and at the same time in second tab user is editing another Product(productID=3). And suppose both are using Session(“ProductID”) stored in session.

So now when user will submit the first tabs product((productID=2), it will go to save the Product(productID=3).

This behavior has been complained a lot.

This behaviour continues in the following schenario too:
1. User A opens an IE instance and logs into a website where a session is created.
2. User A opens another tab and tries to access the same website. Without logging in, the user is already inside the session.
3. In this case, its clear that the session is shared between the tabs.

Solution:
To resolve this issue:
ASP.NET 2.0 offered a simpler solution by way of the following config setting

<sessionState mode=”InProc” cookieless=”UseUri”></sessionState>

you can read more details on the following URL:

http://geekswithblogs.net/ranganh/archive/2009/04/17/asp.net-session-state-shared-between-ie-tabs-and-ie8.aspx

Posted in ASP.Net, ASP.Net | 4 Comments

ASP.Net + Refactor Code

For long time, I am using CodeRush and Refactor! Pro and it is really very helpful to refactor the code. You can download it from the following URL:

http://www.devexpress.com/go/DevExpressDownload_CodeRush3.aspx

:)

Posted in ASP.Net | Tagged , , , | Leave a comment

MS SQL – XQuery : Retrieve element value from a Column with XML Datatype using XQuery?

Suppose we have a “test” table with the following fields:

testID int
testXML XML

Now we have the following records in this “test” table:

1 1Test1

address1

2 2Test2
address2

3 3Test3
address3

4 4Test4
address4

Now, suppose develope has requirements to retrieve Address information for TestID=1.

You can retrieve values of elements from “testXMl” column using the following SQL Query:

SELECT
testID,
[testXML].query(‘/testXML/test/testName/text()’) as Name,
[testXML].query(‘/testXML/test/Address/text()’) as Address
FROM test

Execute this query and you will get the result as below:

testID Name Address
—————————
1 Test1 address1
2 Test2 address2
3 Test3 address3
4 Test4 address4

(4 row(s) affected)

Now, suppose developer has requirements where he has to search only those records which has the testName as “Test2″ or “Test3″.
You can use the following query to achieve the solution:

SELECT
testID,
[testXML].query(‘/testXML/test/testName/text()’) as Name,
[testXML].query(‘/testXML/test/Address/text()’) as Address
FROM test
Where
[testXML].exist(‘/testXML/test/testName/text()[contains(.,"Test1")]‘) = 1

This will retrieve the following result:

testID Name Address
———– ——————
1 Test1 address1

(1 row(s) affected)

Using XQuery, user can retrieve records fast and easily.

Posted in BizTalk Server | 1 Comment