'Static' codebehind session var, to refer to within ASPX?

  • Thread starter Thread starter Antoine
  • Start date Start date
A

Antoine

I have a pretty quickish question about ASPX with codebehind. I have done an
exhaustive search of the web so no go there. I was hoping to reach out for
some help here.

Anyway, I have a really nicely working javascript replace going on with
multiple data items databinded to an aspx web form so that I am
theoretically much simplifying the data sent back from the codebehind
(literally values such as 1,2,3 that can define which webpage to go to).

I think this might be a worthwhile optomisation (as opposed to making a full
hyperlink in each item) - but in terms of performance and overhead I have no
idea.

My problem though, is that I want to store a "prefix" variable for
servertype but get it from the CODEBEHIND and not the aspx code. I want to
perhaps have some code that will define this in a config screen (or search
for server) and then store that in an XML, INI, or CFG file.

And so to my problem. I can refer to session data that has been databinded
to my multiple items, fine. But to create another variable FOR EACH item
would defeat the purpose.

I was a single static variable I can refer to from ASPX, FROM the code
behind eg protected string servertypename as "thisismyservertype"
Can anyone please help me explain if this is possible.

I have considered placing and binding in both codebehind and aspx a very
"small" width field beyond human vision (as I certainly don't want this to
show) but this seems like a poor workaround.
I don't want to display or invoke the config screen on each run time either
( in fact I would prefer have this either manually edited within ini or
managed by a different, perhaps "windows app" exe).

Cheers all!
 
Antoine said:
I have a pretty quickish question about ASPX with codebehind. I have done an
exhaustive search of the web so no go there. I was hoping to reach out for
some help here.

Anyway, I have a really nicely working javascript replace going on with
multiple data items databinded to an aspx web form so that I am
theoretically much simplifying the data sent back from the codebehind
(literally values such as 1,2,3 that can define which webpage to go to).

I think this might be a worthwhile optomisation (as opposed to making a full
hyperlink in each item) - but in terms of performance and overhead I have no
idea.

My problem though, is that I want to store a "prefix" variable for
servertype but get it from the CODEBEHIND and not the aspx code. I want to
perhaps have some code that will define this in a config screen (or search
for server) and then store that in an XML, INI, or CFG file.

And so to my problem. I can refer to session data that has been databinded
to my multiple items, fine. But to create another variable FOR EACH item
would defeat the purpose.

I was a single static variable I can refer to from ASPX, FROM the code
behind eg protected string servertypename as "thisismyservertype"
Can anyone please help me explain if this is possible.

<SNIP>

I have found the answer. It was provided to me on "UK.REC.MOTORCYCLES".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top