473,387 Members | 1,493 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,387 software developers and data experts.

Custom server control... whats wrong and am I on the right track?

Seb
I'm trying to code a calendar control which allows multiply selection
of dates and can read from a datasource. The second part is working.
However I'm having some trouble with the multiply selection part.

The code for my control can be found at http://rafb.net/p/GSVLyd81.html

Should I use the Session object to store my data? Or is viewstate the
right tool for the task?

On line 46 in the method OnSelectionChanged. The condition
SelectedDates.Contains(d) always evaluates to true... I'm really
confused here. and this causes the entire control not to work! any
ideas about what I'm doing wrong?

I'm also looking for best practice feedback as well as answers to the
questions above. There are a few questions in the comments as well.

best regards,
Seb
Jun 27 '08 #1
2 940
Hi,

you definately shouldn't rely on Session if you can't be sure it is used on
pages where session is enabled - vesides what if the control is used twice
on the same page, is that possible? Viewstate is better way, but of course
by trying to minimize what you'd need to put to viewstate.

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

"Seb" <se******************@gmail.comwrote in message
news:fd**********************************@l64g2000 hse.googlegroups.com...
I'm trying to code a calendar control which allows multiply selection
of dates and can read from a datasource. The second part is working.
However I'm having some trouble with the multiply selection part.

The code for my control can be found at http://rafb.net/p/GSVLyd81.html

Should I use the Session object to store my data? Or is viewstate the
right tool for the task?

On line 46 in the method OnSelectionChanged. The condition
SelectedDates.Contains(d) always evaluates to true... I'm really
confused here. and this causes the entire control not to work! any
ideas about what I'm doing wrong?

I'm also looking for best practice feedback as well as answers to the
questions above. There are a few questions in the comments as well.

best regards,
Seb

Jun 27 '08 #2
Seb
On Jun 15, 2:41 pm, "Teemu Keiski" <jot...@aspalliance.comwrote:
Hi,

you definately shouldn't rely on Session if you can't be sure it is used on
pages where session is enabled - vesides what if the control is used twice
on the same page, is that possible? Viewstate is better way, but of course
by trying to minimize what you'd need to put to viewstate.
Good point, thanks!

/Seb
Jun 27 '08 #3

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

Similar topics

7
by: Jed | last post by:
I have a web service method that returns an array of custom objects marked serializeable with fully described public properties. When I bind the results to a DataGrid I can access the properties...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
0
by: Andy Wynn | last post by:
Hello All, I've got a custom control ( Panel-like, but not inheriting from Panel) that has a header region that's custom drawn. Custom Control is using a custom controldesigner class that...
7
by: David | last post by:
i think i just realized i'm an idiot. again. (not syntactically correct code... just pieces to illustrate) class StateObject { members like socket, receiveBuffer, receiveBufferSize,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.