471,112 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,112 software developers and data experts.

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

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?


Apr 22 '06 #1
0 1089

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

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.