473,322 Members | 1,188 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.

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 998
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...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.