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

String Array in ViewState???

Hey guys,

Can anyone tell me how I can do THIS (see code below) but in a STRING
ARRAY instead? I really appreciate any help. I'm using C# in VS2005.
public int intTotal
{
get
{
object value = ViewState["intTotal"];
return value == null ? 0 /* default value */ : (int)value;
}
set
{
ViewState["intTotal"] = value;
}
}


Thanks!!!

Todd
Apr 9 '07 #1
2 10018
Hi Todd,

It should look like this:

public string[] MyStringArray
{
get
{
object value = ViewState["MyStringArray"];
return (string[]) value;
}
set
{
ViewState["MyStringArray"] = value;
}
}

Best Regards,
--
Jorgebg - MCSD.NET
"Todd Jaspers" wrote:
Hey guys,

Can anyone tell me how I can do THIS (see code below) but in a STRING
ARRAY instead? I really appreciate any help. I'm using C# in VS2005.
public int intTotal
{
get
{
object value = ViewState["intTotal"];
return value == null ? 0 /* default value */ : (int)value;
}
set
{
ViewState["intTotal"] = value;
}
}


Thanks!!!

Todd
Apr 9 '07 #2
Thanks!!!

"Jorgebg" wrote:
Hi Todd,

It should look like this:

public string[] MyStringArray
{
get
{
object value = ViewState["MyStringArray"];
return (string[]) value;
}
set
{
ViewState["MyStringArray"] = value;
}
}

Best Regards,
--
Jorgebg - MCSD.NET
"Todd Jaspers" wrote:
Hey guys,

Can anyone tell me how I can do THIS (see code below) but in a STRING
ARRAY instead? I really appreciate any help. I'm using C# in VS2005.
public int intTotal
{
get
{
object value = ViewState["intTotal"];
return value == null ? 0 /* default value */ : (int)value;
}
set
{
ViewState["intTotal"] = value;
}
}


Thanks!!!

Todd
Apr 9 '07 #3

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

Similar topics

3
by: Goh, Yong Kwang | last post by:
I'm trying to create a function that given a string, tokenize it and put into a dynamically-sized array of char* which is in turn also dynamically allocated based on the string token length. I...
8
by: Jeff Johnson | last post by:
Hi, I've begun converting an ASP site over to .NET and I'm a novice at both the new platform as well as C#. I have a COM+ object that returns a string array when it is called. The size of...
11
by: Zordiac | last post by:
How do I dynamically populate a string array? I hope there is something obvious that I'm missing here Option Strict On dim s() as string dim sTmp as string = "test" dim i as integer ...
5
by: Paulers | last post by:
Hello all, I have a string array with duplicate elements. I need to create a new string array containing only the unique elements. Is there an easy way to do this? I have tried looping through...
0
by: madani | last post by:
Hi, I need to get serialized string of Page ViewState in Constructor of my custom web control. I can not override SavePageStateToPersistenceMedium Method of page object because I'm in different...
6
by: Niyazi | last post by:
Hi all, What is fastest way removing duplicated value from string array using vb.net? Here is what currently I am doing but the the array contains over 16000 items. And it just do it in 10 or...
1
by: dotnetnoob | last post by:
i have a arraylist that store String() array the string array hold value 1 2 4 i want to access the string array that is inside the arraylist one arraylist item at the time i search up and...
10
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! Got a simple question. I am new to c# but this is not making me any sence. If i declare: string myStringArray = new string; How the heck could i fill it with more than one element? ...
6
by: Arnshea | last post by:
(apologies for the crosspost) I'm working with an MFC based COM object. From C# I'd like to be able to call a method on the COM object that takes a string array and modifies the contents. Is...
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.