ads

Wednesday, April 8, 2009

Cross-Page Posting ASP .NET

Make 2 forms name it page1.aspx and page2.aspx

on page1.aspx:

Add a TextBox and Button Control

Go to the Button Control Properties and set the PostbackUrl = "~/page2.aspx"

on Page2.aspx:

Add a Label Control and on the Page_Load Event add this following code.

protectedvoidPage_Load(objectsender, EventArgs e)

{

if (PreviousPage != null)

{

if (PreviousPage.IsCrossPagePostBack == true)

{

Label1.Text = "Cross-page post.";

TextBox tb = (TextBox)PreviousPage.FindControl("TextBox1");

this.Title = tb.Text;

}

}

else

{

Label1.Text = "You are not allowed to access this page!";

}

}

Monday, November 3, 2008

Prevent Multiple Click on Saving in ASP.NET

This a very simple task all you have to do is just disable the Save button used in saving the data..

protected void saveButton_Click(object sender, EventArgs e)
{
//to prevent multiple click disable the button
saveButton.Enabled = false;
//-------------------
//Put code to save data
//------------------
//Data is no save so its now okay to enable the button
saveButton.Enabled = true;
}

Saturday, October 11, 2008

How to ADD and USE Master Page in ASP.NET

Step 1:

Make a new Web Project

Step 2:

Click on the Solution Explorer and Add New Item and Select the Master Page

Step 3:

Put a content on your Master Page

Step 4: On the script section of the DEFAULT.ASPX put the MasterPageFile="~/MasterPage.master" tag and delete the html section of the file

Now your ready to go...

Tuesday, September 30, 2008

Calvin's Hub

First of all i would like to greet Calvin's Hub a happy birthday and more traffic to come. In celebration to his first year anniversary Calvin's hub launch it's first contest and it is dubbed as "Calvin's Hub Domain Name Giveaway Contest" obviously the winner will get a free domain name and hopefully it comes with a free domain hosting too. :) so if you want to win your own Domain Name join now. oh before i forget please put me as your referral :) ..

visit : www.calvinshub.com

Google Search