473,770 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.Net VB Web Parts - Connections work fine, until I close, then reopen a web part.

Accidentally put this in normal ASP newsgroup, so reposting:

I'm just starting out with ASP.net, making a web parts intranet.

I'm triyng to get some basic web parts (ascx files) working on a page,
I want them to share a variable, 'StaffID' which one part generates by
looking up the windows login name of the person viewing the page, and
then queries the database to find out the StaffID associated with that
name.

That part then shares it with all the other parts, using a class
called "IMessage", I have set up static connections for each
individual part,

The main part, Jobs_Main.ascx has this code:

Public ReadOnly Property Message() As String _
Implements IMessage.Messag e
Get
Return StaffID
End Get
End Property

<ConnectionProv ider("Message", AllowsMultipleC onnections:=Tru e)_
Public Function GetMessage() As IMessage
Return Me
End Function

to assign the StaffID (which is generated on Page_Load - I also tried
Page_Init and this made no difference)

and then the other parts use

Public _message As IMessage

<ConnectionCons umer("Message") _
Sub SetMessage(ByVa l message As IMessage)
Me._message = message
End Sub

in the scripts and then:
If (Not (_message) Is Nothing) Then
StaffID = "" & _message.Messag e & ""
Else
StaffID = 1
End If

That all works beautifully. If I change the staffID manually on
Jobs_main(in the code) all the others update next refresh. However I
have put in a catalog, and when I close a web part (the part I was
trying was FavouriteLinks. ascx) then add it again, it defaults to the
StaffID of 1...

So I assume it is not getting the _message value, or it thinks the
_message value is 0 for some reason? Does anyone know why this would
be? Could it be that it is loading before the jobs_main web part? If
so how do I make it load afterwards?

May 3 '07 #1
1 1053
anyone who cares, I instead dessided to go with a 'master page' and
use a Session("StaffI D") variable

May 15 '07 #2

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

Similar topics

5
1896
by: brett valjalo | last post by:
Hey Gang! SORRY ABOUT THE LENGTH! Nice to see some of the same faces around this place from way back when ... Whatta buncha CDMA addicts some o' y'all are ;) Don't get me wrong, I understand, believe me! Took me a lot of therapy, various 12-step programmes, interventions by loved ones, etc, but I finally managed to excavate, er, extricate myself from the
17
8452
by: Peter Proost | last post by:
Hi Group, I've got an interesting problem, I don't know if this is the right group but I think so because everything I've read about it so far says it's a .net problem. Here's the problem, we're using crystal reports 9 and vb.net and we're using the crystalrepotViewer to show our reports. But every time we open a report the connection to or sql server remains, so if I open 5 forms with the report viewer I've got 5 sleeping connections in...
4
3324
by: Chris | last post by:
I am using the following function in a windows service. It is fired off by a file system watcher component. It works fine, except for I'll copy in 20 files it has to process at one time. I'll load up MySqlBrowser to check the data, and it says I'm out of connections. (the database is remote) The connections don't clear until I stop the service. Any idea what I'm missing? Thanks Chris
45
3063
by: Arno R | last post by:
Hi all, I am about to distribute an A97-runtime app. which will be used on a LAN by approx. 30 users. The network is pretty good, but there are a few managers who have wireless laptops... Of course they also want to access the db. I am a bit afraid of possible corruption due to the wireless connections. ==> Do I have to be afraid indeed? If so, what is the best way to deal with this? Should I trace the wireless connections...
3
1005
by: db.guru | last post by:
Hello, I was wondering what the best practices are as far as how many connections one should use for a data-driven app. Here's my situation: I have a business object that I load data into, this object also has 3 collections which I also load data into (via their own method). Right now each method has its own connection that uses a datareader to add the items to the collection. I can't use the same connection between the parent object...
37
3988
by: Joshua Ruppert | last post by:
When I'm using FastCGI do I need to code differently than I do when using regular CGI? Because the PHP.exe processes don't go away do global variables stick around from page request to page request, creating the need for better managment / pooling of DB connections? Josh
11
8618
by: atlaste | last post by:
Hi, In an attempt to create a full-blown webcrawler I've found myself writing a wrapper around the Socket class in an attempt to make it completely async, supporting timeouts and some scheduling mechanisms. I use a non-blocking approach for this, using the call to 'poll' to support the async mechanism - rather than the 'begin' and 'end' functions. I already found that connecting doesn't set the "isconnected" variable correctly...
1
964
by: cleanwire | last post by:
Using ASP.Net 2.0 I've created a page with web parts. While using the page, I chose to close the web parts. Now the web parts are gone,even when I close & reopen the browser. How can I get the web parts to show up again? Thanks
1
2156
by: itfetish | last post by:
I'm just starting out with ASP.net, making a web parts intranet. I'm triyng to get some basic web parts (ascx files) working on a page, I want them to share a variable, 'StaffID' which one part generates by looking up the windows login name of the person viewing the page, and then queries the database to find out the StaffID associated with that name. That part then shares it with all the other parts, using a class called "IMessage",...
0
1337
by: itfetish | last post by:
We have a web parts intranet at our office here I have been working on. I have been trying to create a way of getting our OCE TDS 600 plotter queue to be a web part on the page, seeing as their is no way of interfacing apart from their 'print exec workgroup' web based program. So I decided to screen scrape, I've done a scrape of the intranet page of print exec workgroup (http://tds600 on our network) seemed to go fine, then i used...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9910
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.