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

Reference code-behind variable

I am still getting up to speed with ASP.NET 2.0 and its companions (VS, VB,
etc.). I am successfully using a PagedDataSource in my code-behind module,
but I need to reference the PageCount on the page itself to generate links
for the pages. I have tried a few things, but I am still limited to
old-style (one file) thinking. How can I do this without bringing all my
code into the page?

Many thanks,
Tony
Aug 25 '06 #1
2 1782
JF
Hi Tony!

Whether you use Code Behind or not should not change anything, unless I
do not undertsand your problem. Even if the code is in two files:
filename.aspx and filename.aspx.vb, you can still do things as if they
were in one file.

For example, you can do this in the VB file:

Dim a As String
a = "Hello World!"

And then in the aspx page, use:

<%=a%>

to output a's value.

Cheers!

JF

Anthony Bollinger wrote:
I am still getting up to speed with ASP.NET 2.0 and its companions (VS, VB,
etc.). I am successfully using a PagedDataSource in my code-behind module,
but I need to reference the PageCount on the page itself to generate links
for the pages. I have tried a few things, but I am still limited to
old-style (one file) thinking. How can I do this without bringing all my
code into the page?

Many thanks,
Tony
Aug 25 '06 #2
Thank you for replying. I need one more piece of information. I have a sub
that is called in both Page_Load and each time a navigation button is hit.
It has the following declaration:

Dim PagedData As New PagedDataSource

So, the CurrentPage is stored in the ViewState, but the PagedDataSource is
created each time this sub is called. That is the code I picked up from an
article on the web on paging. I think if I pull this declaration out of the
sub to make it global to the class, it may wreck the code. Right?

In this scenario, how do I reference the PageCount of the PagedDataSource in
the HTML page?

Many thanks,
Tony
Aug 25 '06 #3

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

Similar topics

2
by: Craig Nicol | last post by:
Hi everyone, I'm looking for some help migrating my code from Microsoft VC++ 6.0, which was not the most conformant compiler I have now discovered. I'm trying to move to .NET and I've made the...
110
by: Mr A | last post by:
Hi! I've been thinking about passing parameteras using references instead of pointers in order to emphasize that the parameter must be an object. Exemple: void func(Objec& object); //object...
2
by: Zippy | last post by:
Some months ago, we requested help from this newsgroup on how to replace the library reference of a database with another library reference, prior to creating an MDE. I got the following answer...
1
by: S. van Beek | last post by:
Dear reader, An application runs on several pc's. But by one of them a massage pops up with the following information: "Missing or broken reference to the file "PBGNX.ocx" version 1.0".
1
by: S. van Beek | last post by:
Dear reader, I can "able" and "unable" (disable) reference libraries in the reference form of VBA with Tools/References.. But is there code available in VBA to disable a missing...
2
by: JezB | last post by:
Could someone help ? I'm creating a new project and trying to create a web reference to a web library assembly I've referenced quite happily from other web projects. Trouble is : in my new...
3
by: Adam | last post by:
We have a web site that uses .vb for the web pages and .cs for a class module. We are getting the error in .NET 2.0 and VS 2005 beta 2. It does work with .NET 1.1. When trying to access a page...
13
by: al.cpwn | last post by:
I get that these two are different int* get() { static int m; return &m; } int& get() {
29
by: shuisheng | last post by:
Dear All, The problem of choosing pointer or reference is always confusing me. Would you please give me some suggestion on it. I appreciate your kind help. For example, I'd like to convert a...
9
by: Brad Pears | last post by:
I have the following code that references a "textbox" on a form. I want to pass the value of this textbox to a stored procedure as a parameter. This code is located on a different form obviously. I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.