ASP.net Bengali tutorial part-2 || Send page values from one page to another page in ASP.net

There are many ways you can transfer your one page values to another page either using (1) Cookies or (2) Using QueryString. In this tutori...

There are many ways you can transfer your one page values to another page either using (1) Cookies or (2) Using QueryString. In this tutorial I will discuss both of them. In my tutorial I have used visual studio 2005 and .net 2.0. You may use higher version of visual studio, but the procedure and code will remain same. This process will reduce the use of database but it also reduces data security. One have fair knowledge in web address can easily identify those data.

Send Page value using QueryString

This procedure happens on client side but it is slightly different from cookies. Here no data will be stored on client’s machine instead of that page value will be transferred from one page to another.

Step 1:

In this tutorial I have used two pages (1) Default.aspx (2) Default2.aspx

Now in Default.aspx page take two textboxes and two labels and one button. The button will function like, when we click the button TextBox1 and TextBox2 values will be transferred to Default2.aspx page.



Now write the following code on Default.aspx.cs page inside button1_click method.


protected void Button1_Click(object sender, EventArgs e)
{
string url;
url = "Default2.aspx?name=" +
TextBox1.Text + "&email=" +
TextBox2.Text;
Response.Redirect(url);
}

Step 2:

Now on Default2.aspx page take two labels and one TextBox as shown in below picture.



After that write the following code on Deeeeefault2.aspx.cs inside Page_Load method.


protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Request.QueryString["name"];
Label2.Text = Request.QueryString["email"];
TextBox1.Text = Label2.Text;
}



If you face any difficulty in any phase feel free to comment. Very soon I will post about how cookies store page values and how to access that stored data.

Related

ASP.net Tutorial 6847044884868495619

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

Search Here

Popular query

Ads By Google

Get free Update

Enter your email address:

E-mail verification is must for complete subscription

Delivered by FeedBurner

RecentRecommendedComments

Recent

OnePlus Pad 2: A Comprehensive Review

In the rapidly evolving landscape of tablets, OnePlus has made a significant splash with its latest offering, the OnePlus Pad 2. This tablet is packed with impressive specs and features, positioning i...

DLSA Loan Settlement Notice | How to settle | One time Settlement agreement | Advocate guideline

 If your client has received a notice for loan settlement from the District Legal Services Authority (DLSA), this means the matter is being referred for amicable settlement through Lok Adalat or ...

Unfair Means in Public Examinations: A Comprehensive Overview of the Public Examinations (Prevention of Unfair Means) Act, 2024

Public examinations hold a crucial position in shaping the academic and professional trajectories of individuals. Given their importance, the integrity of these examinations is paramount. However, unf...

Difference between section 138 and section 141 of negotiable Instrument Act 1881 with example

Difference between section 138 and 141 of negotiable act in india Section 138 and Section 141 of the Negotiable Instruments Act, 1881, deal with the legal liabilities of individuals and entities in ca...

White smoke from Honda Aviator Scooter exhaust pipe | Problem | Solution

 White smoke from a Honda Aviator scooter's exhaust usually indicates one of the following issues, depending on the type of engine (2-stroke or 4-stroke): 🛵Honda Aviator scooter has a 4-str...

Comments

Urvi Blog:

Nice blog you are posting thanks for your post : BS System Solutions

Make Cash:

UPLOAD SAMPLE FILLED UP FORM OF NOTE SHEET.

Anonymous:

Best blog I received valuable thing it give me full information. thank for making this kind of blog.it help me a lot. for more this kind of information you can check my blog also the International Co...

mithu dowari:

please provide NOC from

Circle AFS on Google Plus!

Follow AFS Google+ page
 

Side Ads

DMCA protected
Information, images and the content on this blog is Copyright ©AFS2011-2018. Please do not copy Any content for commercial purpose else we have to take a legal action. Thanks !!

Total Pageviews

Recent

free counters
 

Connect Us

Speech by ReadSpeaker

item