473,399 Members | 3,888 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,399 software developers and data experts.

Thanks Alot for the viewstate code, can you help this?

Many thanks,
but still need something else.
I made an sql command and the resultant records is stored in array, but when
I click the button to go to the next result it doesn't work.
find the code here

{

If Not ViewState("n") Is Nothing Then

n = CInt(ViewState("n"))

End If

n += 13

ViewState("n") = n

Label27.Text = n

If Not ViewState("n") Is Nothing Then

n = CInt(ViewState("n"))

End If

If Not ViewState("DBval(0 + n)") Is Nothing Then

DBval(0 + n) = CStr(ViewState("DBval(0 + n)"))

End If

Label1.Text = DBval(0 + n)

Label2.Text = DBval(1 + n)

Label3.Text = DBval(2 + n)

Label4.Text = DBval(3 + n)

Label5.Text = DBval(4 + n)

Label6.Text = DBval(5 + n)

Label7.Text = DBval(6 + n)

Label8.Text = DBval(7 + n)

Label9.Text = DBval(8 + n)

Label10.Text = DBval(9 + n)

Label11.Text = DBval(10 + n)

Label12.Text = DBval(11 + n)

Label13.Text = DBval(12 + n)

Label27.Text = n

}

where DBval has values m * 13 (m is the number of the records)
Nov 18 '05 #1
1 1065
Hi

What do you cache here in the ViewState
If Not ViewState("DBval(0 + n)") Is Nothing The
DBval(0 + n) = CStr(ViewState("DBval(0 + n)")
End I

Is "DBval(0 + n)" an name Token for a ViewState Item
If DBval is an array
If Not ViewState("DBval") Is Nothing The
DBval = CStr(ViewState("DBval")
End I

Bin Song, MCP
Nov 18 '05 #2

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

Similar topics

2
by: James Glover | last post by:
I need help... I am trying to set the Viewstate of a var on an onclick event and let the page post back to get the new value. When i click the button, the first time though (on the post back) it...
3
by: Pradeep | last post by:
Hi, I am storing the DataTable in a ViewState. ViewState("mydata") = dsRedemption.T_Redemption_Dtl Then I am casting the ViewState into a DataTable variable. Dim x As New DataTable x =...
3
by: Steve Drake | last post by:
All, I have a CONTROL that contains 1 control (Control ONE), the 1 control that it can contain 1 or 2 control (Control A and B). Control A, raises and event and Control ONE receives this event...
10
by: neo | last post by:
hi, I am studying ASP.NET and have few questions - 1) The session ID and values of controls is stored in VIEWSTATE variable. So now when we put EnableViewState="false" in Page directive and...
2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
7
by: Jan Nielsen | last post by:
Hi all I am learning Asp.Net using Vb.net (VS 2002). I found the following example in a book: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
10
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
10
by: Lloyd Dupont | last post by:
When you define UserControl in source code the sample I see are often like that: ============ public string Text { get { String s = (String)ViewState; return ((s == null) ? String.Empty : s);...
1
by: jelle.huygen | last post by:
Hello, I have a problem in ASP.NET 2.0 with the viewstate of my dynamically added user control. I have reproduced the problem with a very simple user control and a very simple page. On my...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.