473,511 Members | 15,156 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.

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.Message
Get
Return StaffID
End Get
End Property
<ConnectionProvider("Message", AllowsMultipleConnections:=True)_
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

<ConnectionConsumer("Message")_
Sub SetMessage(ByVal message As IMessage)
Me._message = message
End Sub

in the scripts and then:
If (Not (_message) Is Nothing) Then
StaffID = "" & _message.Message & ""
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 2146
it******@gmail.com wrote:
I'm just starting out with ASP.net, making a web parts intranet.
There was no way for you to know it (except maybe by browsing through some
of the previous questions in this newsgroup before posting yours - always a
recommended practice) , but this is a classic asp newsgroup. ASP.Net bears
very little resemblance to classic ASP so, while you may be lucky enough to
find a dotnet-knowledgeable person here who can answer your question, you
can eliminate the luck factor by posting your question to a group where
those dotnet-knowledgeable people hang out. I suggest
microsoft.public.dotnet.framework.aspnet.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 3 '07 #2

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

Similar topics

5
1881
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...
17
8413
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...
4
3315
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...
45
3005
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...
3
989
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...
37
3933
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...
11
8580
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...
1
1045
by: itfetish | last post by:
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...
0
1329
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...
0
7251
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
7367
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,...
0
7430
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...
0
7517
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...
0
5673
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,...
1
5072
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...
0
3230
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...
0
1581
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
790
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.