473,327 Members | 1,896 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,327 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
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 1162

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

Similar topics

5
by: Christian | last post by:
Hi, Viewstate of WebUserControl does NOT work although the 'EnableViewstate'-property of the usercontrol is set to true Description : Using ASP.Net : I have a created a WebPage with 2...
2
by: Christian | last post by:
Hi, Viewstate of WebUserControl does NOT work although the 'EnableViewstate'-property of the usercontrol is set to true Description : Using ASP.Net : I have a created a WebPage with 2...
0
by: Mike Levin | last post by:
Hello Group, I'm using VisualStudio.NET and put a DataGrid into a WebUserControl (an ascx file). For the DataGrid element, I have set AllowSorting="True" and OnSortCommand="Grid_Sort".
2
by: Arun | last post by:
I am new to ASP.NET I need some help for this scenario The scenario is like this I have a template Page which loads a WebUserControl (uct1.ascx) inside a PlaceHolder (PH1) Now this Web User...
2
by: Michael Groeger | last post by:
Hi, I have created a little WebUserControl "SelectTemplate.ascx" which defines a property public class SelectTemplate : System.Web.UI.UserControl { public int PublisherType { get;
1
by: DichkoSoft | last post by:
Hi I create WebUserControl and very confused when use control For Example: ***************************** *wuc.ascx ***************************** <script id=clientEventHandlersJS...
0
by: Christian H | last post by:
Hello, I've just created a WebUserControl that consists of a few other controls such as DropDownList, TextBox and Button. Based on the information entered in the DropDownlist, and TextBox, the...
2
by: Oren | last post by:
Hi everyone, I have WebUserControl on a Webform. How can I sent dynamically to the WebUserControl from a Function/Property on the Webform ? <uc:myuc id="myid1" CurrentPage=<%#GetText()%>...
0
by: Klaus Jensen | last post by:
Hi In a repeater-control, in the <SeparatorTemplatei have placed a webusercontrol, I have made. That works great- However, I want to know be able to only display this WebUserControl a certain...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.