By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,796 Members | 1,205 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,796 IT Pros & Developers. It's quick & easy.

Session Variables or Cookies in Custom Server control

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.