473,403 Members | 2,071 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,403 software developers and data experts.

dynamic objects

The question is quiet difficult to explain -
I need to give the users ability to append to a table rows, that means I
have to reconstruct it every time there's a PostBack i nOnInit event. The
question how can I remember how many rows were sent to client before the
last submit? I've read a little bit about viewstate and tried to make a
hidden label (with runat=server property), but couldn't retrieve its' value
fro ViewState. Please help.
Thank you a lot.

--
With the best wishes,
Shaul Feldman
Nov 18 '05 #1
3 811
Just do this (C# syntax)

ViewState["RowsSent"] = n;

and then

n = ViewState["RowsSent"];

Regards
Jose Marcenaro

"Shaul Feldman" <sf******@writeme.com> escribió en el mensaje
news:e8*************@TK2MSFTNGP11.phx.gbl...
The question is quiet difficult to explain -
I need to give the users ability to append to a table rows, that means I
have to reconstruct it every time there's a PostBack i nOnInit event. The
question how can I remember how many rows were sent to client before the
last submit? I've read a little bit about viewstate and tried to make a
hidden label (with runat=server property), but couldn't retrieve its' value fro ViewState. Please help.
Thank you a lot.

--
With the best wishes,
Shaul Feldman

Nov 18 '05 #2
Thanks a lot! it worked :)
Another small question - If I understand correctly, ViewState saves values
of all objects that have runat=server. How can I isolate a certain object
(let's say an asp:TextBox) that I have on my ASPX page in order to receive
it's value from ViewState? Can I or can't?

And also may be an object/value added/removed/edited to ViewState from
JavaScript??
This one would solve a great problem I have with my project. Thank in
advance.

--
With the best wishes,
Shaul Feldman

"Jose Marcenaro" <jo***@nospam.da-vinci.com.ar> wrote in message
news:OM**************@TK2MSFTNGP09.phx.gbl...
Just do this (C# syntax)

ViewState["RowsSent"] = n;

and then

n = ViewState["RowsSent"];

Regards
Jose Marcenaro

"Shaul Feldman" <sf******@writeme.com> escribió en el mensaje
news:e8*************@TK2MSFTNGP11.phx.gbl...
The question is quiet difficult to explain -
I need to give the users ability to append to a table rows, that means I
have to reconstruct it every time there's a PostBack i nOnInit event. The question how can I remember how many rows were sent to client before the
last submit? I've read a little bit about viewstate and tried to make a
hidden label (with runat=server property), but couldn't retrieve its'

value
fro ViewState. Please help.
Thank you a lot.

--
With the best wishes,
Shaul Feldman


Nov 18 '05 #3
"Shaul Feldman" <sf******@writeme.com> escribió en el mensaje
news:Og*************@tk2msftngp13.phx.gbl...
Thanks a lot! it worked :)
Another small question - If I understand correctly, ViewState saves values
of all objects that have runat=server. How can I isolate a certain object
(let's say an asp:TextBox) that I have on my ASPX page in order to receive
it's value from ViewState? Can I or can't?
You don't have to worry about reading the viewstate of the object. If it has
viewstate, then it will internally use it to pull from it all the control
properties, and you just access TextBox1.Text, TextBox1.Tooltip, etc (you
may do this on PageLoad when IsPostBack=true)
And also may be an object/value added/removed/edited to ViewState from
JavaScript??


Nope. It's an internal proprietary format.
The way to send info from js to your server aspx page is filling an actual
control (i.e. Textbox) or a hidden HTML field placed inside the <asp:Form>
You may access its value either with the .Text property, or with
Request["fieldName"].Value

Hope this help, regards
Jose Marcenaro
Nov 18 '05 #4

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

Similar topics

4
by: Leslaw Bieniasz | last post by:
Cracow, 20.10.2004 Hello, As far as I understand, the generic programming basically consists in using templates for achieving a static polymorphism of the various code fragments, and their...
0
by: Mike Meyer | last post by:
The recent thread on threads caused me to reread the formal definition of SCOOP, and I noticed something I hadn't really impressed me the first time around: it's using staticly checkable rules to...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
1
by: lemonade | last post by:
Hello! Can someone explain to me the difference between dynamic array of pointers vs dynamic array of objects by giving a real life example. Following is the code that I am using for dynamic...
0
by: Pascal Costanza | last post by:
Dynamic Languages Day @ Vrije Universiteit Brussel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monday, February 13, 2006, VUB Campus Etterbeek The VUB (Programming Technology Lab,...
11
by: toton | last post by:
Hi, I have little confusion about static memory allocation & dynamic allocation for a cluss member. I have class like class Bar{ public: explicit Bar(){ cout<<"bar default"<<endl; }
1
by: Chris Curvey | last post by:
I'm trying to track down a performance issue in my Windows code, and hotshot is telling me that the most time and calls are spent in these methods ncalls tottime percall cumtime percall...
7
by: Jo | last post by:
Hi, How can i differentiate between static and dynamic allocated objects? For example: void SomeFunction1() { CObject *objectp = new CObject; CObject object;
7
by: Ronald S. Cook | last post by:
I've always been taught that stored procedures are better than writing SQL in client code for a number of reasons: - runs faster as is compiled and lives on the database server - is the more...
0
by: Alexandre Bergel | last post by:
Dear colleague, Please, note that after the workshop, best papers will be selected, and a second deadline will then be set regarding preparation of the Electronic Communications of the...
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
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.