473,760 Members | 8,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pls HELP: webpart acting as shared but should be user

I have an almost finished page that uses webparts. And this is the
expected functionality. A logged on user hits a button and the button
opens a WebPart. Then the user logs off, next time he logs on he will
find the webpart already open. Now, if a different user logs on, the
fact that another user might have opened a webpart should not affect
the page. For him the page should only show webparts that were open
inside his session.
This is not what is happening right now. Currently, if a user opens a
webpart, and then a different user logs on, the newly logged user will
have whatever webparts that he might have opened in the past plus the
ones opened by other user. Almost like the webpage was being modified
by everybody.

I am creating the WebParts dynamically from user controls using the
LoadControl command; then I use the WebPartManager. CreateWebPart and
last WebPartManager. AddebPart.

I have looked at my config file and the code and everything looks fine.
When I steep through the code after the webpart has been created I can
see this variables.
WebPartManager1 .Personalizatio n.HasPersonaliz ationState equals True
WebPartManager1 .Personalizatio n.Scope is user
WebPartManager1 .Personalizatio n.Enabled equals True

Does anybody know what I am doing wrong? Do I need to save the state?
Arturo Hernandez

May 3 '06 #1
2 1649
DWS
Hey Atherton,
Please post some code for the group to help you or try using the
declaritiviecat alog part.

Good Luck
DWS

"arthernan" wrote:
I have an almost finished page that uses webparts. And this is the
expected functionality. A logged on user hits a button and the button
opens a WebPart. Then the user logs off, next time he logs on he will
find the webpart already open. Now, if a different user logs on, the
fact that another user might have opened a webpart should not affect
the page. For him the page should only show webparts that were open
inside his session.
This is not what is happening right now. Currently, if a user opens a
webpart, and then a different user logs on, the newly logged user will
have whatever webparts that he might have opened in the past plus the
ones opened by other user. Almost like the webpage was being modified
by everybody.

I am creating the WebParts dynamically from user controls using the
LoadControl command; then I use the WebPartManager. CreateWebPart and
last WebPartManager. AddebPart.

I have looked at my config file and the code and everything looks fine.
When I steep through the code after the webpart has been created I can
see this variables.
WebPartManager1 .Personalizatio n.HasPersonaliz ationState equals True
WebPartManager1 .Personalizatio n.Scope is user
WebPartManager1 .Personalizatio n.Enabled equals True

Does anybody know what I am doing wrong? Do I need to save the state?
Arturo Hernandez

May 4 '06 #2
OK, here goes nothing:

Private Function GetWebPart(ByRe f WebPartType As ChuyWebPart) As
WebPart
Dim _WebPart As WebPart
For Each _WebPart In WebPartManager1 .WebParts
If _WebPart.Title = WebPartType.Dis playName Then
Return _WebPart
End If
Next
Return Nothing
End Function

Private Function OpenWebPart(ByR ef WebPartType As ChuyWebPart,
ByRef pWebPartZone As WebPartZone, ByVal ZoneIndex As Integer) As
WebPart
Dim _GenericWebPart As GenericWebPart
_GenericWebPart = GetWebPart(WebP artType)
If _GenericWebPart Is Nothing Then
Dim _UserControl As UserControl = LoadControl("~\ Controls\"
+ WebPartType.Con trolName + ".ascx")
_UserControl.ID = WebPartType.Con trolName
_GenericWebPart =
WebPartManager1 .CreateWebPart( _UserControl)
_GenericWebPart .Title = WebPartType.Dis playName
End If
If Not _WebPartManager 1.WebParts.Cont ains(_GenericWe bPart) Then
_GenericWebPart =
WebPartManager1 .AddWebPart(_Ge nericWebPart, pWebPartZone, ZoneIndex)
End If

Return _GenericWebPart
End Function

There is something I probably need to clarify about my code. I was not
able to make a reference to the user control by type. So as a
workaround the only way I found to get a reference to a WebPart was to
use it's title. I will probably end up undoing this workapound whenever
I find a better way to do that.

Anyway any help will be greately appreciated

May 4 '06 #3

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

Similar topics

1
1838
by: ALI-R | last post by:
I'm writing a webpart which is supposed to connect to a Webserice in our interanet.I am using "RSService.Credentials = System.Net.CredentialCache.DefaultCredentials;"to Authenticate to the webservice.but it dosn't work.why? I think SharePoint which hosts my webpart authenticate the user requesting my webpart and because credential lasts only for one connection ,when web part wants to call webservice there is no credenatial anymore and...
0
3585
by: Joe L via .NET 247 | last post by:
I have written a web part. The webpart calls a web service toget info. I ran into problems with the webservice notresponding. We decided to have a cutoff for the time to waitfor a response from the web service. I am setting the Timeouton the webservice proxy before calling the webservice method. Iam not getting the results I expected. Below is the code andthe exception I get. ... Results results = null; try { MyWebService mws =...
0
1210
by: J. Jespersen | last post by:
Hi people, I fiddling with webparts, and have created my own custom webpart from scratch. The webpart itself is contained in a myPart.dll I have two different sites. SiteA and SiteB. Both are webparts-based. I have added the webpart to my toolbox, and added it to a declarativeCatalogPart, and finally added the webpart to a webPartZone. No problemo. I have allowed the webpart for export, and have exported it to a
1
1771
by: kjartan93a | last post by:
The following code is on my master page, site.master.cs: // programatically add a WebPart from a User Control file Control uc = this.LoadControl(@"ucLotListSimple.ascx"); uc.ID = "MyWp"; GenericWebPart MyWp = WebPartManager1.CreateWebPart(uc); WebPartManager1.AddWebPart(wp2, wpzUpper, 1); The last line above works fine only if the WebPartZone wpzUpper is located on the master page itself.
0
1044
by: arthernan | last post by:
I have an almost finished page that uses webparts. And this is the expected functionality. A logged on user hits a button and the button opens a WebPart. Then te user logs off, next time he logs on he will find the webpart already open. Now, if a different user logs on, the fact that another user might have opeed a webpart should not affect the page. For him the page should only show webparts that were open inside his session. So this is...
0
1064
by: Bei | last post by:
Now I'm facing a requirement that every users can personalize their own web parts, and there is a administrator who has rights 1, to publish a 'personalization' of a single web part to all users in his group. 2, to a 'personalization' of a whole page. my solution to the first problem is: Add a new class inherits the webpart class and implements the IPersonalizable Interface and write code below to personlize: void...
0
906
by: =?Utf-8?B?U2hhbg==?= | last post by:
Hi, I need to develop a web-application, which use form based authentication. In this application, administrator can create a role and add users to the role. I have a requirement where the administrator should able to change the layout of each role in the application. For example, the administrator needs to add a webpart for the role "External". All users belong to the role "External" should get the role level personalization.
0
1225
by: Manpreet | last post by:
Hi, I have a web part page with a toolbar webpart and a grid webpart. In the toolbar, I have menu-items to update a field. For selecting the value of the field I have another asp.net webform which shows the various options in a dropdownlist. This form has to be a modal form and has to be shown on click the Toolbar menu items. When the user selects an option from the drop-down list and click OK then the option selected has to be returned...
4
2110
by: Don | last post by:
I am creating my first WebPart and I’m having trouble figuring out how everything works together. How do I configure a WebPart with settings that will be the same for all users? For example, I have a WebPart and I want an administrator to configure the ConnectString name which will determine which database ConnectString is pulled from the web.config. But once this is configured it will be the same for all users.
0
9521
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9333
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
10107
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...
1
9900
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9765
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
8768
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...
0
6599
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
5214
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
5361
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.