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

Session not available in Visual Studio IDE

Hi,

after I've added a property to my web page I can't open it in Visual Studio
Designer anymore. I get the error message "File couldn't be opened in Web
Forms Designer. [...] enablesessionstate page directive required to use
Session object."

I see that Visual Studio Web Forms Designer seems to execute any Property
code when opening the page. But I don't want it to.

How can I check if my page is in design mode so that I can skip any relevant
code during working in Designer?

TIA,
Axel Dahmen
Nov 19 '05 #1
2 1297
Add property? To ASPX page in a code section or in the CodeBehind? I have
added properties in CodeBehind without any problems, but have not tried in
the ASPX itself, so that is the only thing I know of to look at right now. If
you do not get a good direction, post some code so someone can attempt to
repro your steps.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Axel Dahmen" wrote:
Hi,

after I've added a property to my web page I can't open it in Visual Studio
Designer anymore. I get the error message "File couldn't be opened in Web
Forms Designer. [...] enablesessionstate page directive required to use
Session object."

I see that Visual Studio Web Forms Designer seems to execute any Property
code when opening the page. But I don't want it to.

How can I check if my page is in design mode so that I can skip any relevant
code during working in Designer?

TIA,
Axel Dahmen

Nov 19 '05 #2
Thanks for trying to help me.

I've created a new Page base class derived from Page, MyPage. Now I'm
deriving all my web pages from MyPage instead of Page. This works very well
so far.

Here's the code I've added to MyPage.cs:

public HostApp CurHostApp

{

get {return (HostApp)Session["HostApp"];}

set {if (value==null || value.Count==0) Session.Remove("HostApp");

else Session["HostApp"]=value;}

}
Due to the Session object referenced in this property, VS Web Form Designer
is not able to show me a design view anymore. So I need to know how to tell
if my code is executed from within VS Designer, so that I can comment out
the code like:

{

get {return VisualStudio.ViewedFromWithinDesigner ? null :
(HostApp)Session["HostApp"];}

}

Axel
---------------------
"Cowboy (Gregory A. Beamer) - MVP" <No************@comcast.netNoSpamM>
schrieb im Newsbeitrag
news:94**********************************@microsof t.com...
Add property? To ASPX page in a code section or in the CodeBehind? I have
added properties in CodeBehind without any problems, but have not tried in
the ASPX itself, so that is the only thing I know of to look at right now. If you do not get a good direction, post some code so someone can attempt to
repro your steps.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Axel Dahmen" wrote:
Hi,

after I've added a property to my web page I can't open it in Visual Studio Designer anymore. I get the error message "File couldn't be opened in Web Forms Designer. [...] enablesessionstate page directive required to use
Session object."

I see that Visual Studio Web Forms Designer seems to execute any Property code when opening the page. But I don't want it to.

How can I check if my page is in design mode so that I can skip any relevant code during working in Designer?

TIA,
Axel Dahmen

Nov 19 '05 #3

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

Similar topics

1
by: Novice | last post by:
Hi all, I'm afraid this is the second posting of this information as I didn't get a response on the previous post. I will try to shorten my message (i.e. be more concise) in the hopes that it will...
2
by: Prasad | last post by:
Hello EveryBody, I am using cvs as my version control tool, I came accross CVS SCC plugin for Microsoft Visual Studio name "Jalindi Igloo" I plan to develop a tool like this, but have no idea to...
4
by: PaulThomas | last post by:
WHY does the .Net Documentation show http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebsessionstatehttpsessionstatememberstopic.asp .NET Framework Class...
34
by: John Timbers | last post by:
I'd like to purchase Visual C# .Net for learning purposes only since it's a lot cheaper than Visual Studio (note that I'm a very experienced C++ developer). Can someone simply clarify the basic...
9
by: William LaMartin | last post by:
Does anyone know when we can actually purchase Visual Studio 2005 Professional or the upgrade and have it shipped immediately? First Microsoft said that it would be released Nov. 17. When Nov...
0
by: Kevin G. Anderson | last post by:
What: CAUG Meeting - Visual Studio 2005 Tools for Office When: Thursday, April 27, 2006, 6PM Who: Jacob Cynamon, Microsoft Where: The Information Management Group 200 W. Monroe St. Suite...
18
by: surfrat_ | last post by:
Hi, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: The Microsoft...
1
by: John Kotuby | last post by:
Hi all, I have experienced several problems after installing SP1 for Visual Studio 2005 Professional. The problems are occurring on 2 different Windows XP SP2 development machines that have been...
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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...
1
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: 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: 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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.