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

collections in c# (long...)

Hi,

I'm quite new to c# and OO programming, in brief...

I developed a 'classic' ASP / MSXML application, so I used VBsricpt for
the logic, xml files for storing informations and standard XSLT to
apply the due transformations and having the page displayed.

So no spaghetti-code at all, all the HTML elements are stored in the
XSLT files, the ASP pages has just to:

1 Retrieve the informations from the client thru hidden forms or
quesrystrings requests;
2 Store those values to variables;
3 Passing the values as parameters to the XSLT stylesheet;

Once passed in the XSLT stylesheet the values are stored in hidden
forms the client can later access thru javascript / dom operations.

This is the very common fashion for the XML / XSL community to develop
a client - server application, and suppose we have a parameter to
communicate both ways the route would be something like:
HTML page
================================================== ====

<html>
<head>
</head>
<body>
<form name="ciao" method="post">
<input name="paramId" type="hidden" value="">
<input type="button" onClick="document.ciao.paramId.value =
'newValue'">
</form>
</body>
</html>
ASP page
================================================== ====

dim paramId

'the variable is then initialized and if no form has been retrieved
'we assig zero, this way we can determine if is the first time we're
accessing
'to the page or if we are posting back. in .net this process is
automated
'in the prtty same way.

if paramId != "" then

paramId = request.form("paramId")

else

paramId = 0

end if

...

xml / xsl objects instantiation

...

'passing the parameter to the XSL stylesheet

xslProcessor.addParameter "paramId", paramId

XSLT page
================================================== ====

<xsl:stylesheet version="1.0">

<xsl:param name="paramId"/>

....
template stuff
....

<input type="hidden" name="paramId" value="{$paramId}"/>

</xsl:stylesheet>

Since the procedural approach has been very straightforward perform
such and other tasks, now I want to port my application in a dot.net
environment so I can perform even much compless tasks, at this point I
was wondering if ther could be any way to automate this process, I know
one of the most shouted isuues of asp.net is the use of web forms in a
similar fashion, but I need to keep my xslt files standard, so
basically avoiding " <asp:something> " elements in the stylesheets...
now, coming back to topic of my post:

If I have different parameters to communicate client - server, is there
any way I could collect them and later access them in som loop cycle?

Given the field name is always the same of the param name and the form
name, I would be able to do something like this:

//storing the variables in a struct or a class

public struct myVars
{
public int paramId;
public string paramName;
public int paramAge;
public int paramBirthday;
}

//once declared assigning their value
//I'm not sure at all about the syntax,
//it would be something like that anyway

public class assignValue
{
for each var in myVars

var.value = request[var.name];

next
}

//then i pass the params to the stylesheet in the same way...
//even less sure about the syntax!!

public class passParams
{
for each var in myVars

parms.AddParam(var.name, "", var.value);

next
}

So I basically need to store the parameters in field only once in my
program, then access them or as a group via a loop cycle or singularly
via a method or a property set (which seems to me the best thing to
do).

I tried to use indexers but later I can access the members oly via the
index reference, which is not the case, I'm considering other kinds of
collections but I'm not sure they can perform what I need them to.

I'm not even sure if it's possible to to accomplish similar task...

Any suggestion would ne appreciated!!!!

bye

marcello

Apr 20 '06 #1
0 1088

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

Similar topics

8
by: Arnaud Debaene | last post by:
Hello all, One area where the .Net framework 1.1 is really poor is Collections : We've got very few choice concerning the containers and their characteristics (for example, ArrayList, Queue and...
3
by: aa7im | last post by:
I am trying to design a good domain model for a system I am working on but I am having a hard time trying to figure out how to deal with relations and transaction... For example if I create an...
2
by: Rachel Suddeth | last post by:
Every time I read about these things my brain gets muddled and I can't keep them straight. I'm going to give my guesses, could someone confirm or deny? I think a collection doesn't have to be...
2
by: Howard Swope | last post by:
Could someone help explain thread safety issues in the System.Collections classes? The documentation states:...
3
by: Rob Thomas | last post by:
Hi, I've been tasked to come up with a new architecture for a large application at one of my customer's sites. In the past, I have developed multi-tier applications whereby the business...
7
by: rodchar | last post by:
hey all, i was checking out time tracker on asp.net one of the starter kit projects. i was wondering why the users datagrid gets loaded the way does. first it pulls all the users in from a...
5
by: Atley | last post by:
I am trying to set up a nested collection so I can run statements like this: me.lblquestions.text = mysteps.item(1).questions(1).Asked Any ideas on how to do this? I have created a...
3
by: Paul | last post by:
Hello, I'm upgrading a small single user app to VB.NET and have a few questions about loading classes & collections classes with the data from a one to many dataset structure. I'm serializing...
4
by: nhmark64 | last post by:
Hi, Does System.Collections.Generic.Queue not have a Synchronized method because it is already in effect synchronized, or is the Synchronized functionality missing from...
2
by: SimonDotException | last post by:
I am trying to use reflection in a property of a base type to inspect the properties of an instance of a type which is derived from that base type, when the properties can themselves be instances of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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

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.