|
Hi,
When i execute application in debug mode it works but on release mode the session values in the website is lost. I use windows server 2003 and IIS 6. It is a 5 step enrollment process whose values are carried forward across pages. It throws error "object reference not set to instance of object and points to session values" when moving across pages in release mode.
Pls advise.
Thanks
Priya
|
|
|
|
|
Hi,
There are two things you can try.
First of all before accessing the values from the Session check if the value is null and if not only asssign it.
By this way you could over come the exception been throws.
Secondly for your Session expiration, just increase the session time out period and see if it works.
Use this code in Web.Config
<system.web>
<sessionState timeout="60"/>
</system.web>
Note: timeout is stated in minutes
Also, just check if your session is stored in memory or some where else.
In case it could be stored in some where else.
So if you have the tag SessionState check the mode property.
If not mentioned it will be stored in memory by default.
Hope it helps.
Thx,
Gayani
|
|
|
|
|
Hi There are many reasons to reset the session data
1.fails of aspnet_wp or w3wp services while you are using Inproc session mode.
2. modification to Bin directory, Web.config , machine.config, global application file .
3.low memory on the server , where the server may dump the old sessions ....
and in case you dont appeneds the sessionId while using cookieless sessions,a new session will assigned to the browser .
I think in your case you may have made some modifications in web.config
Again whenver you are reading data from any varaible that can be null for any reason make sure first check that should not null
Is your problem got resolved ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
hello,
is there a way to get the session name?,i'm adding a new form page to a website all know is that for exemple session[0]='someString'. can i get the name of the session for exemple "HelloWorld", as
session["HelloWorld"]='someString'.
thank you for your help
|
|
|
|
|
Can you be a little more clear?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
As Paul said, you're not being very clear - however I think this may point you in the direction you want to go....
Dim instance As HttpSessionState = HttpContext.Current.Session
Dim value As NameObjectCollectionBase.KeysCollection = instance.Keys
Dim key As String
For Each key In value
Response.Write("Session(""" & key & """) = " & CStr(Session(key)) & "<br />")
Next
(You will need to amend this if any of your session variables contain values that can't be converted to strings...)
|
|
|
|
|
Dear phil,
first of all thank you for your answer, i'm developing a form using (c# asp.net) and i'm adding it to anexisting website which i don't have the source code. all i could get are the session without their names. so i have session[0]='159900' but i don't know its name
hope i'm now a little bit more clear.
thank you for your help
|
|
|
|
|
How are you adding to Session ?
If you are adding ussing index then you should retrive in same way (providing the same index)
If you are giving a name(as key) while adding but while retriving you don't have that name then you can't get as there might gave n number of key value pairs in the Session
By the way why you want to retrive the name from session ?
Session.Keys will return all the Keys (name) stored in that session
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
thank you a lot the last world you said was the answer
|
|
|
|
|
You can get what's put into session:
Session["HelloWorld"] = "Hello, my name is Tim.";
Response.Write(Session("HelloWorld"));
You should see "Hello, my name is Tim."
Or are you asking about enumerating the Session collection?
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
|
sameera28 wrote: i m making a final yr project
..so what have you been doing for your other years? Nothing to do wtih programming, judging by your questions. Don't expect anyone else to do work for you when you can't be bothered to do any for yourself.
|
|
|
|
|
Person has the following properties :ID, Resume, Name, Gender
Resume is a Class too, it has the following properties: ID, ResumeName, Date, Content
Now , I get a collection IList<person>.
I binded the collection to Gridview, like this:
CS file:
IList< Person > personList = getPersonList();<br />
<br />
GridView.DataSource = personList;<br />
Gridview.DataBind();
aspx file:
<asp:boundfield headertext="name" datafield="Name" xmlns:asp="#unknown" /><br />
<asp:boundfield headertext=" gender" datafield=" resumename" xmlns:asp="#unknown" /><br />
<asp:boundfield headertext="ResumeName" datafield=" Resume" xmlns:asp="#unknown" /><br />
<asp:boundfield headertext=" Date" datafield=" Resume " xmlns:asp="#unknown" />
modified on Tuesday, September 16, 2008 10:56 AM
|
|
|
|
|
What is the problem you are facing?
|
|
|
|
|
Hi
I want to extract sustrings from a string and want to store in an array.
The string is dynamic it will change but the criteria to extract substring is same.
say for example a string str="something is [!better] than [!nothing]"
so i need to extract [!better] and [!nothing] from the string and store it in a string array, the string is dynamic it changes but i need to extract data between [ and ] including both the square brackets.
If anybody can send any sample code, I will be very thankfull.
Thanks
Ansari
|
|
|
|
|
// I could be off by one
string strXX = "xxx [ xxx ],,,,";
int startX = strXX.IndexOf("[");
int endX = strXX.IndexOf("]");
strXX.Substring( startX, (endX - startX+1);
// I hopes this help; Signed... Linda
xxx
|
|
|
|
|
hi,
i am getting this error when i am redirecting to a page using httpcontext.current.server.transfer(url,true) which is in try{}
|
|
|
|
|
don't put the code in the try catch block whenever you are redirecting to another page with second parameter true it is going to throw exception
remove try and catch block and check
Let me know if it got fixed
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Hi,
thanks.. it got fixed
|
|
|
|
|
Hi Friends
i need to design rating system like code project rating.Any help how design.I design using ajaxControlTool kit but i need like hand symbols with rating
Thanks in Advance
your's subbu
|
|
|
|
|
Can you not just change the image to hands instead?
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
With some knowledge of math, creating a rating system is pretty trivial. What is it, exactly, you are having trouble with?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi guys
Is there a way to catch the onclick of a linkbutton in gridview seperatly to the onselectedindexchanged event for the gridview?
thanks
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
Yes you can do it by assigning some command Argument to link buttons
Now whenever you click link button Default event of gridview is going to call (don't remember the name) In that event check the event argument for the if this are the one you assign for Link button meand link button is clicked call the business rules you want to implement
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Im developing in C# and im changing the selected index of a combox box dynamically during coding, and on selectedindex event i want to load another combobox. My problem is the second combobox is not being loaded when the first one's changed during runtime, its only trigering the selectedindex changed when i do a click, does nayone know whats missing from my code.
|
|
|
|