I am working on someone else's code and I ran into a situation where I was able to cut and paste a rather large chunk of their work - cool, saved a lot of time. The only weird thing was that they have this.
When i tried to run that in my new page I get an error saying that the specified cast is invalid. First I thought maybe I was losing the session var somehow - that isn't the case so I did this...Code:contact.Id = (int)Session["ContactId"];
Works just fine!Code:int contactId = int.Parse(Session["ContactId"].ToString()); contact.Id = contactId;
Anyone have any idea why this works in one page and not the other? Maybe the other developer is just cooler than I am? (just kidding)
Thanks




Reply With Quote