|
An instance for the Page class is created for every request.
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
So it does not do some sort of object pooling ?
for every request it creates an object from that class, serve the request, destroy the object ?
well... ok, thanks!
----------------------
!happy coding!
|
|
|
|
|
zu78 wrote: for every request it creates an object from that class, serve the request, destroy the object ?
AFAIK yes, silly isnt it?
static instances are persisted on application level, but be aware ASP.NET tends to go into 'sleep' mode and the values get reset.
Other option is to use the Session object. You can just save object instances there that will be persisted for the current session of the user, which is porbably what you are looking for
Eg:
string id = Session["login"] as string;
...
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
leppie wrote: You can just save object instances there that will be persisted for the current session of the user, which is porbably what you are looking for
Err... no. What I want is a method of passing objects between a class and it's subclass in a concurrent-access-safe-manner and only in the scope of a request/response (I need something like java's Request.setAttribute).
ViewState is great, but IMHO only for intranet applications.
But, if your answer is correct... I've found it.
Thanks!
----------------------
!happy coding!
|
|
|
|
|
leppie wrote: static instances
Oxymoron alert
|
|
|
|
|
J4amieC wrote: Oxymoron alert
Ok, wise ass, what would you call it? Maybe not techinically correct, but everyone (bar you) seems to understand it as "an instance of a class that is a static member in some class".
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
lol calm down... it was a bit of sarcasm.
|
|
|
|
|
Hello,
I have a bizarre problem that i've boggled my mind about for awhile. I just can't figure this one out. Ok, I have an ITEMIDLIST structure in C# and I've defined the COM IShellFolder interface. Here's the problem:
I want to retreive the icon for the desktop using the system image list and the SHGetFileInfo folder. The only way to do this is to pass the SHGFI_PLID flag with the ITEMIDLIST structure converted to an LPCSTR (this is how you do it in C++). In C# i have to pass a string to the SHGetFileInfo function and I want to convert my ITEMIDLIST structure to a string with each character being the bytes of the structure.
Is there any way to do this? If i pass the string "C:/Documents and Settings/Username/Desktop", I will get the folder icon which is correct for this path. I want that little blue icon. Any ideas. If I need to be more specific, just ask and I'll try to rephrase the question.
RockmanHero2003
My computer finally got faster...I threw it out the window and it went very fast.
|
|
|
|
|
i am writing media player in C# and i can play most of the media file. expect cda files, audio cd files. and i am having hard time geting that worked. any help be nice.
|
|
|
|
|
Hello Everyone, it's me again. I am working on this project and I am trying to make dynamic buttons, but it wont go in to my event handler for some reason.
here is my code
<br />
<br />
GenericButton = new Button();<br />
GenericButton.Click += new System.EventHandler(GenericButton_Click);<br />
<br />
GenericButton.Text = "Update";<br />
GenericButton.ID = "Button_" + counter.ToString();<br />
<br />
cell2.Controls.Add(GenericButton);<br />
<br />
|
|
|
|
|
Hi there,
Generally, if u want to add dynamically controls,u have to add them again after each post back. Otherwise, they are lost
BTW, this should be posted on ASP.NET forum
<< >>
|
|
|
|
|
In addition, they should be created during the LoadViewState event, before calling hte base method. Otherwise, you won't get the events because the controls won't exist when viewstate is restored.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks to the both of you for replying. Do you guys have examples of how to do that?
|
|
|
|
|
override LoadViewState, and put the code in there to create the buttons, that's all, really.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I have a scenario , where i send some sensitive information to a message queue (msmq) and that message should not in cleartext, so i need that message should be of encrypted one..
Here i mean the data transfer and as well as storage of message as well
Is that possible? Please provide code or KB for the same
thx in advance
Happy coding!!
kotteeswaran
-- modified at 17:22 Monday 31st October, 2005
|
|
|
|
|
You should use the System.Cryptography namespace for any data encryption, and not write your own code.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi chris,
Do you have any code sample or KB link for this?
Related to MSMQ..
thx
Happy coding!!
kotteeswaran
|
|
|
|
|
No, I know nothing about MSMQ, but you should use the built in stuff for any cryptography at all. Do you have access to google ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You mean Goolge mail ? goolge groups ?
Happy coding!!
kotteeswaran
|
|
|
|
|
I mean google.com - where you type in something like "C# Cryptography" and get a ton of links to the sort of info you're after.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I need to get the coordinates of a click outside of my form, can anybody show me a quick example of doing this?
|
|
|
|
|
If you can interop it, there's a method for capturing the mouse so that you can get the first click, otherwise you need a system wide hook to catch mouse activity outside your form.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
could you give me an example on how to interop it?
|
|
|
|
|
Sure, I'll look it up for you
Here[^] is a CP article on the API
Here[^] is the API interop code.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|