Hi coders, Currently I am going through a bit complicated problem. It would be great if I get help from you. The issues is, I have "print this page" button on each page on my site. Where I have called "window.print()". Now my client wants customised footer on that including his logo etc. So now, on that print button, I popup a window and pass the content to another predifed page with footer. Its working nice if only 1 page print is their, but if content is big and expands to 2 or more pages then my footer is printed on last page only (Obviously). So, I wrote a code for manipulating the Registry Key for "Microsoft\\Internet Explorer\\PageSetup". Code is below:
string strPath = "Software\\\\Microsoft\\\\Internet Explorer\\\\PageSetup";
Microsoft.Win32.RegistryKey oKey = null;
/\* The following lines of code takes care that error does not occur if registry settings are not at proper path.\*/
oKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey (strPath, true);
if (oKey != null)
{
oKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(strPath, true);
}
else
{
oKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey (strPath, true);
}
string strKey = "footer";
//object oValue = "&u&b&d";
object oValue = "test footer";
oKey.SetValue (strKey, oValue);
strKey = "header";
oValue = "&d";
oKey.SetValue(strKey, oValue);
/\* You can also get the value in registry by following line of code
string strValue=oKey.GetValue (strKey).ToString();\*/
oKey.Close();
But, I think this will modify Server machine's registry value not client machine's. Is their any other way to cop-up with this issue?? Any help will be greatful. Thanks,
Anand Desai Developer Atharva Infotech