473,672 Members | 2,597 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.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 2152
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.publi c.dotnet.framew ork.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
1888
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
8437
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
3320
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
3049
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
1000
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
3969
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
8597
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
1050
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 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.
0
1333
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
8404
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
8828
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7446
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
6238
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
4227
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...
0
4418
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2819
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 we have to send another system
2
2063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1816
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.