473,387 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Referencing values from aspx page to aspx page

Using this code to create a passable parameter
<%@ Page Language="C#" ClassName="FirstPageClass" %><html><head><script runat="server"

public string FirstName
{
get
{
return first.Text;
}
public string LastName
{
get
{
return last.Text;
}
void ButtonClicked(object sender, EventArgs e)
{
Server.Transfer("secondpage.aspx");
</script>

this allows the parameter to be accessed from another page that references it, but the value seems to be only used in certain conditions... any suggestions to pass variables from aspx page to aspx page???

Nov 16 '05 #1
3 1137
Session variables.

"Lane" <an*******@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
Using this code to create a passable parameter
<%@ Page Language="C#" ClassName="FirstPageClass" %><html><head><script runat="server">
public string FirstName
{
get
{
return first.Text;
}
}

public string LastName
{
get
{
return last.Text;
}
}

void ButtonClicked(object sender, EventArgs e)
{
Server.Transfer("secondpage.aspx");
}

</script>

this allows the parameter to be accessed from another page that references it, but the value seems to be only used in certain conditions... any
suggestions to pass variables from aspx page to aspx page???

Nov 16 '05 #2

for passing small amount of data that only needed for the duration of a request, the cleanest solution is to use HttpContext.Items

----- Lane wrote: ----

Using this code to create a passable parameter
<%@ Page Language="C#" ClassName="FirstPageClass" %><html><head><script runat="server"

public string FirstName
{
get
{
return first.Text;
}
public string LastName
{
get
{
return last.Text;
}
void ButtonClicked(object sender, EventArgs e)
{
Server.Transfer("secondpage.aspx");
</script>

this allows the parameter to be accessed from another page that references it, but the value seems to be only used in certain conditions... any suggestions to pass variables from aspx page to aspx page???

Nov 16 '05 #3
Look at
http://msdn.microsoft.com/library/de...formspages.asp

That's much easier, I think, than the inline code you're doing. I use the
method outlined in the link above a lot and have never had any problems
accessing the properties of the source page.

Good luck,

Dale

"Lane" <an*******@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
Using this code to create a passable parameter
<%@ Page Language="C#" ClassName="FirstPageClass" %><html><head><script runat="server">
public string FirstName
{
get
{
return first.Text;
}
}

public string LastName
{
get
{
return last.Text;
}
}

void ButtonClicked(object sender, EventArgs e)
{
Server.Transfer("secondpage.aspx");
}

</script>

this allows the parameter to be accessed from another page that references it, but the value seems to be only used in certain conditions... any
suggestions to pass variables from aspx page to aspx page???

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Martin | last post by:
Hello Group I'm having a bit of trouble figuring this out. I'm grateful for any hints. Let's assume I'm have a webapplication with two .aspx pages, Page A and Page B. Page A consists of a...
4
by: darrel | last post by:
I have a contact form that a person submits to the server. In ASP, you'd make a page, post the form to another page, which would grab the values and do somethign with them. in ASP.NET, it...
6
by: Mikey_Doc | last post by:
Hi We are running cms 2002, Framework 1.0 with Visual studio 2002. We have just upgraded to Framework 1.1 and visual studio 2003. All of our database connection strings are stored within the...
5
by: Amelyan | last post by:
I am struggling here trying to determine what is a good programming practice as far as referencing your URLs. When you use Response.Redirect, do you use 1) Hard-coded string --...
4
by: TWEB | last post by:
I think I may have an IIS / ASP.Net Configuration issue that I need some guidance with resolving. Here's the problem: a) I have a .stm file. b) I referenc a .aspx file on this .stm file using a...
3
by: gary | last post by:
Hi, I am trying to reference an anchor in a user control with a url. This worked in 1.1 but no longer works in 2.0. The ascx control is located in a "/include" folder If you have a...
7
by: Ugo Van Noorbeeck | last post by:
Hi all, I try to reference several pages from a class (ideally located in a class library). But no namespace is available to do this. Does anybody have an idea how to do this? Thanks for...
4
by: steve_barker333 | last post by:
Hi guys! I keep getting the following error reported by VS 2005 in my ASP.NET 2.0 web project: "The type or namespace name 'MainPages_XXX' could not be found (are you missing a using...
2
by: =?Utf-8?B?SmFtZXMgUGFnZQ==?= | last post by:
Hi all I have a user control - mycontrol.ascx with various controls within it. mycontrol.ascx is utilised in myPage.aspx I have a class (class1) to carry out various functions, subs etc. How...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.