473,385 Members | 1,834 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,385 software developers and data experts.

Link Button Menu, Master page

On my master page i have build 5 link buttons. First Page I receive ID
and set the ID in master page Property so i can do the work with it.
How ever when i clicked to second button i lose this ID.
How would i keep this ID thru these 5 pages. so i wont lose this ID..

Master.page
link1 link2 link3,
public string AppID
{
get { return Label1.Text; }
set { Label1.Text = value;}
}
page1.aspx
Response.write(Master.AppID); // I have the ID to work with it..
MyFunc(Master.AppID);
page2.aspx
When i click on link2 on master page, i come page2 and i dont have
this
Master.AppID
even though i have
<%@ MasterType virtualpath="~/MyMaster.master" %referance on aspx
page...

How can i carry out this ID thru all the link click..

Apr 7 '07 #1
6 4171
You should store the ID in session.

Me.Session.Add(), etc.

If this is unacceptable for some reason and you never leave the page then
you can look at using ViewState.

Me.ViewState.Add(), etc.

Let me know if this helps.

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"Matt" <me*******@Hotmail.comwrote in message
news:11**********************@q75g2000hsh.googlegr oups.com...
On my master page i have build 5 link buttons. First Page I receive ID
and set the ID in master page Property so i can do the work with it.
How ever when i clicked to second button i lose this ID.
How would i keep this ID thru these 5 pages. so i wont lose this ID..

Master.page
link1 link2 link3,
public string AppID
{
get { return Label1.Text; }
set { Label1.Text = value;}
}
page1.aspx
Response.write(Master.AppID); // I have the ID to work with it..
MyFunc(Master.AppID);
page2.aspx
When i click on link2 on master page, i come page2 and i dont have
this
Master.AppID
even though i have
<%@ MasterType virtualpath="~/MyMaster.master" %referance on aspx
page...

How can i carry out this ID thru all the link click..

Apr 7 '07 #2
They might move the application on farm later so i did not wanted deal
with session or cookies.
Though i will try view state.. Thanks for that.
I am confuse that i cant receive the master page property on second
page / link
Master.AppID is getting me the value though i have it available on
intellisense

Would there be a better design or solution for this..
Create 5 link/job page. Do the jobs on those pages for that ID..
Apr 7 '07 #3
On Apr 7, 2:44 am, "Matt" <meteha...@Hotmail.comwrote:
They might move the application on farm later so i did not wanted deal
with session or cookies.
Though i will try view state.. Thanks for that.
I am confuse that i cant receive the master page property on second
page / link
Master.AppID is getting me the value though i have it available on
intellisense

Would there be a better design or solution for this..
Create 5 link/job page. Do the jobs on those pages for that ID..

Since this is second link second page, I dont have the ViewState
information on second page
view state is no good

Apr 7 '07 #4
Okay, well, I can only assume I'm following what's going on/what you're
trying to do.

Remember that pages are rebuilt each time by the ASP.Net runtime you make a
page request - that means that if you go to another page, even if it uses
the "same" master page, it's really a completely seperate instance of that
master page class - so you're really doing no good by setting property
values on that class because the second time everything will have been
recreated for you by scratch.

I haven't done much server farm development so someone else might offer a
better solution, but maybe store something in your query string?

Again, I'm not totally following every inch of what your'e trying to do. I'm
not as good when the code isn't right in front of me....

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"Matt" <me*******@Hotmail.comwrote in message
news:11**********************@q75g2000hsh.googlegr oups.com...
On Apr 7, 2:44 am, "Matt" <meteha...@Hotmail.comwrote:
>They might move the application on farm later so i did not wanted deal
with session or cookies.
Though i will try view state.. Thanks for that.
I am confuse that i cant receive the master page property on second
page / link
Master.AppID is getting me the value though i have it available on
intellisense

Would there be a better design or solution for this..
Create 5 link/job page. Do the jobs on those pages for that ID..


Since this is second link second page, I dont have the ViewState
information on second page
view state is no good

Apr 7 '07 #5
On Apr 7, 3:02 am, "Ben Rush" <kwen...@yahoo.comwrote:
Okay, well, I can only assume I'm following what's going on/what you're
trying to do.

Remember that pages are rebuilt each time by the ASP.Net runtime you make apagerequest - that means that if you go to anotherpage, even if it uses
the "same"masterpage, it's really a completely seperate instance of thatmasterpageclass - so you're really doing no good by setting property
values on that class because the second time everything will have been
recreated for you by scratch.

I haven't done much server farm development so someone else might offer a
better solution, but maybe store something in your query string?

Again, I'm not totally following every inch of what your'e trying to do. I'm
not as good when the code isn't right in front of me....

--
~~~~~~~~~~~
Ben Rushhttp://www.ben-rush.net/blog

"Matt" <meteha...@Hotmail.comwrote in message

news:11**********************@q75g2000hsh.googlegr oups.com...
On Apr 7, 2:44 am, "Matt" <meteha...@Hotmail.comwrote:
They might move the application on farm later so i did not wanted deal
with session or cookies.
Though i will try view state.. Thanks for that.
I am confuse that i cant receive themasterpageproperty on second
page/link
Master.AppID is getting me the value though i have it available on
intellisense
Would there be a better design or solution for this..
Create 5link/jobpage. Do the jobs on those pages for that ID..
Since this is secondlink secondpage, I dont have the ViewState
information on secondpage
view state is no good- Hide quoted text -

- Show quoted text -
Appricate the help. I try to keep it in xml and carry it over the
request. Since i have been asked to hide the query sting..

Apr 7 '07 #6
// Submit this search term to google...
profile overview site:msdn2.microsoft.com

--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
"Matt" <me*******@Hotmail.comwrote in message
news:11*********************@y80g2000hsf.googlegro ups.com...
On Apr 7, 3:02 am, "Ben Rush" <kwen...@yahoo.comwrote:
>Okay, well, I can only assume I'm following what's going on/what you're
trying to do.

Remember that pages are rebuilt each time by the ASP.Net runtime you make
apagerequest - that means that if you go to anotherpage, even if it uses
the "same"masterpage, it's really a completely seperate instance of
thatmasterpageclass - so you're really doing no good by setting property
values on that class because the second time everything will have been
recreated for you by scratch.

I haven't done much server farm development so someone else might offer a
better solution, but maybe store something in your query string?

Again, I'm not totally following every inch of what your'e trying to do.
I'm
not as good when the code isn't right in front of me....

--
~~~~~~~~~~~
Ben Rushhttp://www.ben-rush.net/blog

"Matt" <meteha...@Hotmail.comwrote in message

news:11**********************@q75g2000hsh.googleg roups.com...
On Apr 7, 2:44 am, "Matt" <meteha...@Hotmail.comwrote:
They might move the application on farm later so i did not wanted deal
with session or cookies.
Though i will try view state.. Thanks for that.
I am confuse that i cant receive themasterpageproperty on second
page/link
Master.AppID is getting me the value though i have it available on
intellisense
>Would there be a better design or solution for this..
Create 5link/jobpage. Do the jobs on those pages for that ID..
Since this is secondlink secondpage, I dont have the ViewState
information on secondpage
view state is no good- Hide quoted text -

- Show quoted text -

Appricate the help. I try to keep it in xml and carry it over the
request. Since i have been asked to hide the query sting..

Apr 7 '07 #7

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

Similar topics

3
by: rachel | last post by:
Hi all, I am new in ASP.Net. I have a question on link multiple web forms together. Here is the scenario: I create an Index.aspx WebForm which consists of a banner and three navigator...
6
by: Andreas Prilop | last post by:
What exactly are Chapters and Sections in the <LINK REL=...> tag? I have put some <LINK REL="Chapter"> tags into http://www.unics.uni-hannover.de/nhtcapri/bidirectional-text.html Is this the...
4
by: Miguel Dias Moura | last post by:
Hello, I created a datalist in an ASP.Net / VB page. I display the image and price of a few products. When a user clicks an image I want to load the page "detail.aspx?number=id" and send the...
2
by: Sisnaz | last post by:
I'm working with 2005 Beta 2 and I'm sure this is a trivial question but for the life of me I can't figure out. I placed a menu navigation componet on my master page and defined the navigation...
4
by: Bart | last post by:
Hi, I have a menu on my master page. When I click on a menu item the state is reset after the page is redirected to the NavigateURL. How can fix this? Thanks Bart
7
by: tfsmag | last post by:
Has anyone had a problem with putting a menu control into a master page in .net 2.0? I have a problem where if i just drop a menu control on a regular page the menu works fine, the submenus work...
6
by: Ben Fidge | last post by:
Hi I've just created a new Master Page for my site and it uses the native Menu control. Strange behaviour is happening on page that use the master page. For some reason, the menu controls...
7
by: Bon | last post by:
Dear all I create a master page with image buttons on the left-hand side for navigation. When a user clicks the student button, the content (i.e. ContentPlaceholder) in masterpage will be...
2
by: Keith G Hicks | last post by:
I'm confused about how to code a link button to go to the page I need (asp.net 2.0) My root is "Website1" Here's the layout for the purposes of this question: Website1 (folder)...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.