Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 link each browser instance to a specific account

Author  Topic 

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-05-24 : 16:49:42
I want to be able to open 2 or more browser instances. When the user works in one specific instance, it will be related to specific data to one account number. If he switches to another browser instance (same windows session, browsers are all Internet explorer), he will be working on different account number.

1/ How do I do that?
The purpuse is not to mix up the different data and not put the wrong data from one account number which is supposed to be related to the other account number.
It s like opening multiple forms in windows form applications (MDI forms ) but each form will be in seperate browser instance.

2/ What does Microsoft call this issue?

Thanks.

MichaelP
Jedi Yak

2489 Posts

Posted - 2006-05-24 : 18:14:05
I'm not sure I completly understand, but I think if you have your standard hidden form fields (<input type=""hidden"" name="accountid" value="accountidhere">) you should be able to do something like this.

I tend to think you are making things a bit too complicated for your users though if you are "forcing" them to use mulitlpe browsers. If this is just for advanced users I think you'll be ok though.

Michael

<Yoda>Use the Search page you must. Find the answer you will. Cursors, path to the Dark Side they are. Avoid them, you must. Use Order By NewID() to get a random record you will.</Yoda>

Opinions expressed in this post are not necessarily those of TeleVox Software, inc. All information is provided "AS IS" with no warranties and confers no rights.
Go to Top of Page

JBelthoff
Posting Yak Master

173 Posts

Posted - 2006-05-24 : 18:36:49
You mean something like this?

<a href="/accounts.aspx?accid=1" title="Account 1" target="_blank">Account 1</a>
<a href="/accounts.aspx?accid=2" title="Account 2" target="_blank">Account 2</a>
<a href="/accounts.aspx?accid=3" title="Account 3" target="_blank">Account 3</a>
etc...

JBelthoff
D
odge, Duck, Dip, Dive & Dodge
If a man can dodge a wrench, he can dodge a ball!
Asp Hoting Provider
Go to Top of Page

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-05-25 : 14:01:45
It s like working with MDI for Windows Forms applications, but instead of opening the different form instances in one browser I want to be able to open each instance in a seperate browser instance
I ll try to write an email more clear soon
Thanks for your interest
Go to Top of Page

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-05-25 : 15:16:36
I have a windows application where I open multiple account forms at the same time (account forms looks the same but are related to different account numbers including the information for different customers), I also allow the user to open Subscriber forms related to each account,and feature forms.
I want to be able to implement the same application but in Web ASP.net application. So I want to allow the user to work on different accounts at the same time. That s why I m talking about multiple browser instances and MDI in Windows Forms applications
Thanks
Go to Top of Page

dfiala
Posting Yak Master

116 Posts

Posted - 2006-05-25 : 16:20:25
You can link a different page to each account. This could be in a tabbed browser such as firefox, or with multiple instances of a IE. However, don't think about it as browser instances, think about it as pages, which is all a web server really knows about.

To do this, you just need to keep track of the specific account ID on each page, so it is posted back with each request. Best bet is to do it with ViewState.

I'm guessing from previous discussions that you are working with objects. To manage storing the objects with your user's session and associating them with the proper web page instance, use a hashtable to manage the account objects and store them in the session. We'll add a few private properties to your form...

Private Property AccountID as Integer
Get
Return ViewState("AccountID")
End Get
Set (ByVal Value as Integer)
ViewState("AccountID") = Value
End Set
End Property

Private Property AccountObject as YourAccountObjectTypye
Get
Return Accounts(AccountID)

End Get
Set (ByVal Value as YourAccountObjectType)
Dim Accounts as HashTable
if IsNothing(Session("Accounts")) then
Accounts = new Hashtable
Session("Accounts") = Accounts
else
Accounts = Session("Accounts")
end if
if Accounts.Contains(Value.ID) then 'assumes you have an ID property on your object, change as needed
Accounts(Value.ID) = Value
else
Accounts.Add(Value.ID, Value)
end if
AccountID = Value.ID
End Set
End Property

Then when you first create your object, store it for later use, this will also update the ID associated with the page

AccountObject = new YourAccountObjectType()

Then when you post back, using the
AccountObject property
will always get you the account associated with the page instance, because it is using the page's view state to retrieve the account object's ID.

Note, your session memory usage coule get very high if you don't occassionally clean out the hash table holding all the objects. But that is an issue for another day



Dean Fiala
Very Practical Software, Inc
Now with Blogging...
http://www.vpsw.com/blogbaby
Microsoft MVP
Go to Top of Page
   

- Advertisement -