Friday, February 25, 2011

How to set iframe content controls value from Parent page

hi guys following sample will help for set iframe content controls value from Parent page

Parent page
-----------

..body onload="setiframevalues()"/..

function setiframevalues() {
window.frames[0].document.getElementById('txtname').value = "Welcome";
window.frames[0].document.getElementById('txtname2').value = "Manikandan";

}

iframe calling page Sample
----------------------------

Name
.....input id="txtname" type="text" ...

name2
...input id="txtname2" type="text"...

Saturday, February 12, 2011

Sql Server Start /Stop Services using bat file

how To prepare Bat file for Starting and stopping sql server Services

1)For Starting Sql Server Services

Create the Notepad File

NET START MSSQL$SQLEXPRESS

Save as *.Bat File


1)For stopping Sql Server Services

Create the Notepad File

NET STOP MSSQL$SQLEXPRESS

Save as *.Bat File

Happy Coding....

Thursday, February 3, 2011

Asp.net using C# open Fullscreen popup page or same page as fulll screen

Hi.,

Following Code Will help for, Open any page as full screen Page.
And it will avoid same page opens multiple Times

Sample Code

protected void FullScreenMode()
{
StringBuilder FullScreenScript = new StringBuilder();
//Check the name of the opened window in order to avoid of window re-open over and over again...
FullScreenScript.Append("if(this.name != 'InFullScreen')");
FullScreenScript.Append("{" + Environment.NewLine);
FullScreenScript.Append("window.open(window.location.href,'InFullScreen','fullscreen=yes,menubar=yes,toolbar=yes,status=yes,scrollbars=auto');" + Environment.NewLine);
FullScreenScript.Append("}");
this.ClientScript.RegisterStartupScript(this.GetType(), "InFullScreen", FullScreenScript.ToString(), true);
}

Wednesday, February 2, 2011

Access Modifiers (C# Programming Guide)

All types and type members have an accessibility level, which controls whether they can be used from other code in your assembly or other assemblies. You can use the following access modifiers to specify the accessibility of a type or member when you declare it:

public
The type or member can be accessed by any other code in the same assembly or another assembly that references it.

private
The type or member can be accessed only by code in the same class or struct.

protected
The type or member can be accessed only by code in the same class or struct, or in a class that is derived from that class.

internal
The type or member can be accessed by any code in the same assembly, but not from another assembly.

protected internal
The type or member can be accessed by any code in the assembly in which it is declared, or from within a derived class in another assembly. Access from another assembly must take place within a class declaration that derives from the class in which the protected internal element is declared, and it must take place through an instance of the derived class type.


Default Access Modifiers
------------------------
Class:
=====

class sample
{
}

Default Access Modifiers :internal

structure:
==========

struct sample
{
}

Default Access Modifiers :internal

Note:
structure Won't support Protected

InterFace:
=========

Interface sample
{
}

Default Access Modifiers :internal


Enum:
====

enum sample
{
}

Default Access Modifiers :Public



Methoeds,Property,Field
========================
Default Access Modifiers :Private

Ineterface Methoeds
===================
Default Access Modifiers :Public


Happy Coding..........

Tuesday, February 1, 2011

how to encrypt viewstate in asp.net

Following Property will use for encrypt the ViewState

1)EnableViewstateMac="true"

2)ViewstateEncryptionMOde="Always"



Note:

If we encrypt the view state means application will get slow..