468,765 Members | 1,144 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

WebUserControl State

Dear Friends,

I have a decision to make and hope to get some insight: I have built
several WebUserControls one of which is a WebUserControl that queries an SQL
server database, retrieves a filename and loads an image control. The
WebUserControl itself contains an SQLDataSource and an image box. I also
have other WebUserControls that implement the same concept as previously
mentioned.

The SQLDataSource is bound to a session variable (PictureID - Image
path and filename retrieved from SQL server) which works correctly from
within my ASP.NET application. This works in part because when a user logs
into my ASP.NET application, I query an SQL database table and set up all my
session variables (PictureID, PatientID, etc...). The problem is as follows:

I also use this WebUserControl in another page which is accessed from a
URL and NOT my ASP.NET application. Therefore, there are no session
variables initialized as the user is anonymous (non-authenticated). Thus, my
image does not load because the SQLDataSource cannot bind itself to a session
variable that does not exist or is nothing.

What I would like to do is pass this image path and filename from the
base/parent page to the WebUserControl, and perform a hard select instead of
tying the SQLDataSource to a session variable. Is this good practice or is
there a better way. Usually, its WebUserControls that raise events to the
base/parent form, and not the other way around which is what I am thinking of
right now. Any ideas?

Regards,

GiovanniP
Apr 22 '06 #1
0 1059

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Christian | last post: by
reply views Thread by Mike Levin | last post: by
2 posts views Thread by Arun | last post: by
2 posts views Thread by Michael Groeger | last post: by
1 post views Thread by DichkoSoft | last post: by
reply views Thread by Christian H | last post: by
2 posts views Thread by Oren | last post: by
reply views Thread by Klaus Jensen | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.