Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
This is my DB table :

SQL
CREATE TABLE [dbo].[Organisation](
    [OrganisationID] [int] IDENTITY(1,1) NOT NULL,
    [OrganisationName] [nvarchar](50) NULL,
    [CreatedAt] [datetime] NULL DEFAULT (getdate()),
 CONSTRAINT [PK_Organisation] PRIMARY KEY CLUSTERED
(
    [OrganisationID] ASC



And in the design part we have only Organisation Name, the user has to enter the Organisation name then it will redirects to register page :

there it contains his personal details and also again the organisation name has to be displayed. so have taken organisation as foreign key but how to write the code to get the organisation name what he entered in 1st page to the 2nd page.
Posted

You can use the state management techniques to do that. You can pass the values in QueryString or you can even pass them using session variables. The technique you want to use depend on the type of data(i.e. how secure it should be).

refer to this article to understand some techniques and see which one suits your requirements: A Beginner's Tutorial on ASP.NET State Management[^]
 
Share this answer
 
use..session["your best practice name"]..and recieve it in the 2nd page...

in 1st page on buttonclick use Session["your best practice name"]=your textbox.Text;

in 2nd page recieve it as Your label.Text=(string)Session["your best practice name"];
 
Share this answer
 
Hi,

I am not clear about your question, but as I understand I think you need some help on join query.
SQL Server Joins[^]

Now you need Session variables.

Exploring Session in ASP.NET[^]
 
Share this answer
 
v2
You can pass the parameter from one page to other.
In the Page_Load handler of the second page, get the source page from the Context.Handler object
Get the property values from the source page and use them as you would any object properties.

Refer the below link

http://msdn.microsoft.com/en-us/library/aa713401(v=vs.71).aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900