Cross Page posting in ASP.NET 2.0

http://www.beansoftware.com/asp.net-tutorials/cross-page-posting.aspx

validations in textbox in vb.net(its allow only no's

VB
Private Sub TextBox1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.Leave
If Not IsNumeric(TextBox1.Text) Then
MessageBox.Show("You must enter a numeric value!", _
"Please try again....", MessageBoxButtons.OK, _
MessageBoxIcon.Exclamation)
Me.Focus()
End If
End Sub


Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

If Not ((Convert.ToInt32(e.KeyChar) >= 48 AndAlso Convert.ToInt32(e.KeyChar) <= 57) OrElse Convert.ToInt32(e.KeyChar) = 46 OrElse e.KeyChar = Convert.ToChar(Keys.Space) OrElse e.KeyChar = Convert.ToChar(Keys.Back)) Then
e.Handled = True
End If


End Sub


C#
private void textBox2_Leave(object sender, EventArgs e)
{
String s = textBox2.Text;
Int32 result = 0;

Int32.TryParse(s, out result);

// result will equal zero if the parse failed.

if (result == 0)
MessageBox.Show("Invalid Value");
}
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
int keyAscii = (int)e.KeyChar;

if ((keyAscii >= 48 && keyAscii <= 57) || e.KeyChar == Convert.ToChar(Keys.Back))
{

e.Handled =
false;

}

else
{

e.Handled =
true;

}
OR

if (!((Convert.ToInt32(e.KeyChar) >= 48 && Convert.ToInt32(e.KeyChar) <= 57) || Convert.ToInt32(e.KeyChar) == 46 || e.KeyChar == Convert.ToChar(Keys.Space) || e.KeyChar == Convert.ToChar(Keys.Back)))
{
e.Handled = true;
}

}

delay signing

During development process you will need strong name keys to be exposed to developer which is not a good practice from security aspect point of view.In such situations you can assign the key later on and during development you an use delay signing.

Following is process to delay sign an assembly:
--> First obtain your string name keys using SN.EXE.
--> Annotate the source code for the assembly with two custom attributes from System.Reflection: AssemblyKeyFileAttribute, which passes the name of the file containing the public key as a parameter to its constructor. AssemblyDelaySignAttribute, which indicates that delay signing, is being used by passing true as a parameter to its constructor.

The compiler inserts the public key into the assembly manifest and reserves space in the PE file for the full strong name signature. The real public key must be stored while the assembly is built so that other assemblies that reference this assembly can obtain the key to store in their own assembly reference.
-->Because the assembly does not have a valid strong name signature, the verification of that signature must be turned off. You can do this by using the –Vr option with the Strong Name tool.The following example turns off verification for an assembly called myAssembly.dll.

Sn –Vr myAssembly.dll

-->Just before shipping, you submit the assembly to your organization's signing authority for the actual strong name signing using the –R option with the Strong Name tool. The following example signs an assembly called myAssembly.dll with a strong name using the sgKey.snk key pair.

Sn -R myAssembly.dll sgKey.snk

====================================(OR)==================================

When signing an assembly, you might not always have access to a private key. For example, an organization might have a closely guarded key pair that developers do not have access to on a daily basis. While the public key might be available, access to the private key is restricted to a few individuals. In such a case, you can use delayed or partial signing to provide the public key, deferring the addition of the private key until the assembly is handed off.

Delay signing can be enabled in the Signing pane of the Project Designer as follows.

To delay sign an assembly
1.With the project node selected in Solution Explorer, from the Project menu, click Properties (or right-click the project node in Solution Explorer, and click Properties).

2.In the Project Designer, click the Signing tab.

3.Select the Sign the assembly check box.

4.Specify a key file. For more information, see How to: Sign an Assembly (Visual Studio).

5.Select the Delay sign only check box. Note that a delay signed project will not run and cannot be debugged. You can, however, use the Strong Name Tool (Sn.exe) with the -Vr option to skip verification during development.

refer

http://msdn.microsoft.com/en-us/library/t07a3dye.aspx