473,385 Members | 1,925 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.

triplets

I just stumbled across some code with triplets, but I'm not sure what
they are used for. Why not just use ViewState instead? Can anybody
enlighten me?
Cheers,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
7 3495
Could you post the code?

Nov 17 '05 #2
It was code from the MSDN, it shows the use of triplets but doesn't
really explain why you would want to use them. Are they just like
creating a ViewState collection?
Cheers,

Mike
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3
Could you post a link to the page on MSDN, then? I searched for
'triplets' and got dozens of hits that have nothing to do with C# or
..NET.

Nov 17 '05 #4
Hi,

Well, this is the first time I see this class :)

According to MSDN the only use of it is tu allow a more efficent way to
add objets to a server side control's ViewState.

Maybe in the ASP.NET you can get a more detailed answer.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Mike P" <mi*******@gmail.com> wrote in message
news:u%***************@TK2MSFTNGP12.phx.gbl...
I just stumbled across some code with triplets, but I'm not sure what
they are used for. Why not just use ViewState instead? Can anybody
enlighten me?
Cheers,

Mike

*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #5
Bruce,

Here's a link to MSDN Triplet Class :

http://msdn.microsoft.com/library/de.../en-us/cpref/h
tml/frlrfsystemwebuitripletclasstopic.asp
Cheers,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #7

"Mike P" <mi*******@gmail.com> wrote in message
news:u%***************@TK2MSFTNGP12.phx.gbl...
I just stumbled across some code with triplets, but I'm not sure what
they are used for. Why not just use ViewState instead? Can anybody
enlighten me?


It's just a silly serializable class with three public properties. Nothing
fancy at all.

However, When I need to have several values that belongs together in
ViewState (or in Session or in any List really); I typically define a
lightweight private class with public fields (I think properties are
overkill for such a class) as a placeholder for my values. Then I put and
read an instance of that class to the Dictionary.

The benefit is that there are now only one key in the Dictionary that
reduces the risk of collissions between aspx/ascx and also only one downcast
from Object to retrieve all values typesafe. I also find the code more
readable.

Hence, if I needed three values in ViewState that belongs together; I would
write my own class and not use that Triplet-thingy.

Happy Coding
- Michael S

Nov 17 '05 #8

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

Similar topics

20
by: Dominik Kaspar | last post by:
i want to initialize a constant list at the beginning of a python program. but the list is too big for one line. is there any possibility to spread the list over several lines, so that the code...
6
by: Marco Aschwanden | last post by:
I want to store a file in the application directory. What is the easiest way to figure out, where my application is situated? sys.argv does not work for my purposes... do you have any other...
9
by: majsen | last post by:
Hi, I have problem running this query. It will time out for me... My database are small just about 200 members. I have a site for swaping appartments (rental). my query should look for match in...
6
by: The Master | last post by:
As the subject states, I'm having issues with if else statements that are testing true in IE but false in Mozilla. At first I Thought maybe the way I was splitting the string was leaving trailing...
13
by: Ben | last post by:
I have a program which is using a lot of memory. At the moment I store a lot of pointers to objects in std::vector. (millions of them) I have three questions: 1) Lets say the average Vector...
8
by: Jon Weston | last post by:
I'm setting up an Access2003 database with pictures. I put a bound ole picture ctrl on a form that's source is the table that contains the pictures and follow ALL the directions for embedding a...
1
by: vinoraja | last post by:
There are a number of reasons we don't implement Multiple Implementation Inheritance directly. (As you know, we support Multiple Interface Inheritance). However, I should point out that it's...
30
by: ggnguser | last post by:
It's part of a test and I'm stumped. There is a function void foo(char **x) The function signature is given and cannot be changed, so no passing of other values. The test case involves...
62
jkmyoung
by: jkmyoung | last post by:
Does anyone have some super, super hard Sudoku puzzles? Back in February this year, I had enough time to finally program a Sudoku solver in Java. Right now, I'm looking for solvable puzzles, but...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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,...

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.