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

Session Variables or Cookies in Custom Server control

I created a custom server control whose rendering logic relies on
session variables and cookies. It works just fine at run time. The
problem is at the design time, because session variables and cookies are
not available, so that I get error messages. I just wonder if there are
any way such as conditional compile options to overcome the problem? Thanks

Charles Zhang
Oct 8 '06 #1
4 2315
Howdy,

I 'm afraid you can't. this is not proper way of coding custom server
controls - provide properties instead that can be set from any type of data
medium.

Hope this helps
--
Milosz Skalecki
MCP, MCAD
"Charles Zhang" wrote:
I created a custom server control whose rendering logic relies on
session variables and cookies. It works just fine at run time. The
problem is at the design time, because session variables and cookies are
not available, so that I get error messages. I just wonder if there are
any way such as conditional compile options to overcome the problem? Thanks

Charles Zhang
Oct 8 '06 #2
Hello Charles,

As Milosz has mentioned, so far there hasn't a means for us to seamlessly
make our custom webserver control's rendering code work 100% correctly at
both design-time and runtime. Especially when you access some runtime
specific or design-time specific states or data in your control's rendering
code.

Actually, for custom webserver control, we recommend that our control's
rendering code(control creation code logic) dedicated to runtime features.
For design-time specific presentation, you create a custom controldeisgner
for your custom control and override the "GetDesignTimeHtml" to output the
html content which will be displayed in designer surface. here are some web
article and msdn reference about using custom designer for web server
control:

#Custom Control Designers : Design-time HTML
http://aspalliance.com/articleViewer.aspx?aId=436&pId=

#ASP.NET Control Designers Overview
http://msdn2.microsoft.com/en-us/library/wxh45wzs.aspx

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 9 '06 #3
Thank you very much for the points. I think I can find my own way to
work out the problem.

Charles Zhang

Steven Cheng[MSFT] wrote:
Hello Charles,

As Milosz has mentioned, so far there hasn't a means for us to seamlessly
make our custom webserver control's rendering code work 100% correctly at
both design-time and runtime. Especially when you access some runtime
specific or design-time specific states or data in your control's rendering
code.

Actually, for custom webserver control, we recommend that our control's
rendering code(control creation code logic) dedicated to runtime features.
For design-time specific presentation, you create a custom controldeisgner
for your custom control and override the "GetDesignTimeHtml" to output the
html content which will be displayed in designer surface. here are some web
article and msdn reference about using custom designer for web server
control:

#Custom Control Designers : Design-time HTML
http://aspalliance.com/articleViewer.aspx?aId=436&pId=

#ASP.NET Control Designers Overview
http://msdn2.microsoft.com/en-us/library/wxh45wzs.aspx

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Oct 10 '06 #4
Thanks for the reply Charles,

Please feel free to post here if there is anything else we can help.
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 10 '06 #5

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

Similar topics

3
by: PM | last post by:
I'm trying to make a kind of search history containing the 3 last searched words. So I'm using 3 Session Variables: Word1 / Word2 / Word3. In order to get this history working, I need to put the...
14
by: qaz | last post by:
I've always used session cookies in my web sites. However, since more and more people (including me) are starting to disable cookies, I'm beginning to think that I should change my ways and design...
2
by: What-a-Tool | last post by:
I am using a couple of session variables in my site. From what I can figure out, session information is stored on the users computer in a cookie - If the user has cookies disabled, do session...
14
by: Paul Yanzick | last post by:
Hello, I am trying to develop a book tracking application for my capstone in school, and am running into a problem. The application is an ASP.Net application written in C#. The first page you...
5
by: Abhilash.k.m | last post by:
This is regarding the session management using Out of proc session management(SQL SERVER). Among the samples below which one is better to set the session? 1. There are 20 session...
13
by: Alexander Widera | last post by:
hi, who has seen the follow problem or could help please? i visit a page .... i read a sesssion-var . ... everythink works...... i visit the page again..... error ... the sessionvar is null .... i...
14
by: Rick | last post by:
We are in the process of testing a large web project that I converted from VS 2003 to VS 2005. Everything seems to be working except for a few minor things. But the main issue I have is this, I...
3
by: Sylvie | last post by:
When redirecting a page, For example CASE 1; Response.Redirect("Page.aspx?Paramval=123"); in Page.aspx
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.