Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. I want to dynamically access particular session of the application [Its urgent]

I want to dynamically access particular session of the application [Its urgent]

Scheduled Pinned Locked Moved ASP.NET
24 Posts 6 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H hardikr shah

    I am working with .Net 2.0, and I have condition in which user can delete data of a deal, but same deal is viewed by another user. So while user is going to delete, the another user got message that this particular deal is deleted by this particular user.And user is redirected to home page.

    V Offline
    V Offline
    Vimalsoft Pty Ltd
    wrote on last edited by
    #2

    Then what is your Problem ? What does this has to do with Sessions ?

    Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za www.ITS.co.za

    H 1 Reply Last reply
    0
    • H hardikr shah

      I am working with .Net 2.0, and I have condition in which user can delete data of a deal, but same deal is viewed by another user. So while user is going to delete, the another user got message that this particular deal is deleted by this particular user.And user is redirected to home page.

      A Offline
      A Offline
      anilpal
      wrote on last edited by
      #3

      HI, This requirement cannot full fill with the only using of session object. You have to work around that.

      Regards Anil Pal

      H 1 Reply Last reply
      0
      • V Vimalsoft Pty Ltd

        Then what is your Problem ? What does this has to do with Sessions ?

        Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za www.ITS.co.za

        H Offline
        H Offline
        hardikr shah
        wrote on last edited by
        #4

        I don't know how to access another session user, while current session user is going to delete data, means i want to know is there any way to access another session user and give the message from current session user.

        V 1 Reply Last reply
        0
        • A anilpal

          HI, This requirement cannot full fill with the only using of session object. You have to work around that.

          Regards Anil Pal

          H Offline
          H Offline
          hardikr shah
          wrote on last edited by
          #5

          Hi Anil, I am not using only session, I am making it with help of global.asax and Application_start events. But my problem is how to give message to another session user from current user.

          A C 2 Replies Last reply
          0
          • H hardikr shah

            Hi Anil, I am not using only session, I am making it with help of global.asax and Application_start events. But my problem is how to give message to another session user from current user.

            A Offline
            A Offline
            Amit Sk Sharma
            wrote on last edited by
            #6

            ur end target is to show username in message ie."Deleted by ". Is it?

            With Thanks & Regards Amit Sk Sharma

            H 1 Reply Last reply
            0
            • H hardikr shah

              I don't know how to access another session user, while current session user is going to delete data, means i want to know is there any way to access another session user and give the message from current session user.

              V Offline
              V Offline
              Vimalsoft Pty Ltd
              wrote on last edited by
              #7

              If i understand you correctly you want to notify another user before they delete a record that it has been viewed.If so Sessions will not help you here. The First Thing you need to do. Before a User Deletes you must make sure that there is no other User who has retrieved the record. Now there are many ways to do that. its either , when a User selects a Record it must be Locked with his name and when another user selects it and try to delete it , it must say the username name bla bla has locked the record and you cannot delete it. and when a user that locked the record is done with the data, you can unlock the data for the user to do what ever. Locking data may result into dead locks

              Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za www.ITS.co.za

              1 Reply Last reply
              0
              • H hardikr shah

                Hi Anil, I am not using only session, I am making it with help of global.asax and Application_start events. But my problem is how to give message to another session user from current user.

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #8

                You can only tell your other user that something was deleted after the fact, or you can lock records that are open and forbid deletion ( what most people do ).

                Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )

                H 1 Reply Last reply
                0
                • A Amit Sk Sharma

                  ur end target is to show username in message ie."Deleted by ". Is it?

                  With Thanks & Regards Amit Sk Sharma

                  H Offline
                  H Offline
                  hardikr shah
                  wrote on last edited by
                  #9

                  hi Amit, My end target is not just display user name, but i want to display it to users which are viewing same data, Means take an example, that there is student records 1,2,3,4. there are users A,B,C Now A is viewing student recored 1. B is viewing student record 2. Now if C is going to delete student record 1, then A will get message that "student record 1 is deleted by A" all the data are come from database means A,B,C and 1,2,3,4. And please send me if you have solution. Thanks

                  1 Reply Last reply
                  0
                  • C Christian Graus

                    You can only tell your other user that something was deleted after the fact, or you can lock records that are open and forbid deletion ( what most people do ).

                    Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )

                    H Offline
                    H Offline
                    hardikr shah
                    wrote on last edited by
                    #10

                    hi Graus, My end target is not just display user name, but i want to display it to users which are viewing same data, Means take an example, that there is student records 1,2,3,4. there are users A,B,C Now A is viewing student recored 1. B is viewing student record 2. Now if C is going to delete student record 1, then A will get message that "student record 1 is deleted by A" all the data are come from database means A,B,C and 1,2,3,4. And please send me if you have solution. Thanks

                    A 1 Reply Last reply
                    0
                    • H hardikr shah

                      hi Graus, My end target is not just display user name, but i want to display it to users which are viewing same data, Means take an example, that there is student records 1,2,3,4. there are users A,B,C Now A is viewing student recored 1. B is viewing student record 2. Now if C is going to delete student record 1, then A will get message that "student record 1 is deleted by A" all the data are come from database means A,B,C and 1,2,3,4. And please send me if you have solution. Thanks

                      A Offline
                      A Offline
                      Amit Sk Sharma
                      wrote on last edited by
                      #11

                      U can put a log there in DB with user ID of the person deleting record. When any one tries to fetch deleted data refer log table first and if it has entry for the same; pick user name from there and if no record exists for tht student(ur example)in log, pick actual data and display it. Hope it will give u a solution

                      With Thanks & Regards Amit Sk Sharma

                      H 2 Replies Last reply
                      0
                      • A Amit Sk Sharma

                        U can put a log there in DB with user ID of the person deleting record. When any one tries to fetch deleted data refer log table first and if it has entry for the same; pick user name from there and if no record exists for tht student(ur example)in log, pick actual data and display it. Hope it will give u a solution

                        With Thanks & Regards Amit Sk Sharma

                        H Offline
                        H Offline
                        hardikr shah
                        wrote on last edited by
                        #12

                        I want to save database round trip because there are 20 pages, and each page load if I will go to check whether this particular record is deleted by another user. I think it is not an fesiable way.

                        1 Reply Last reply
                        0
                        • H hardikr shah

                          I am working with .Net 2.0, and I have condition in which user can delete data of a deal, but same deal is viewed by another user. So while user is going to delete, the another user got message that this particular deal is deleted by this particular user.And user is redirected to home page.

                          D Offline
                          D Offline
                          Dev S
                          wrote on last edited by
                          #13

                          Hi, First point is this how you are going to notify the user who is already watching the deal(until he refreshes the page). So its better lock it while it is viewed by other and for this create a log in ur db in synchronisation with ur Session variable..

                          H D 2 Replies Last reply
                          0
                          • D Dev S

                            Hi, First point is this how you are going to notify the user who is already watching the deal(until he refreshes the page). So its better lock it while it is viewed by other and for this create a log in ur db in synchronisation with ur Session variable..

                            H Offline
                            H Offline
                            hardikr shah
                            wrote on last edited by
                            #14

                            Hi, I know, but in my application, I have to allow both user to view and same data, but if any of one is deleting the data then I have to give message that this data is deleted by this particular user. And redirect another user to home page. So I have to access, another session user, from current user session. Means if current user is going to delete data, at the same time he can access the another user, who is seeing same data, and he will give message that data is going to be deleted. Thanks

                            D 1 Reply Last reply
                            0
                            • H hardikr shah

                              I am working with .Net 2.0, and I have condition in which user can delete data of a deal, but same deal is viewed by another user. So while user is going to delete, the another user got message that this particular deal is deleted by this particular user.And user is redirected to home page.

                              D Offline
                              D Offline
                              Dev S
                              wrote on last edited by
                              #15

                              I got an idea but it will slow down ur page litlle bit.. use ajax and refresh the dataset after some time say 3 seconds and if it dont find any data there then just display a alert message the record has been deleted.. So it suits ur requirement??

                              H 1 Reply Last reply
                              0
                              • A Amit Sk Sharma

                                U can put a log there in DB with user ID of the person deleting record. When any one tries to fetch deleted data refer log table first and if it has entry for the same; pick user name from there and if no record exists for tht student(ur example)in log, pick actual data and display it. Hope it will give u a solution

                                With Thanks & Regards Amit Sk Sharma

                                H Offline
                                H Offline
                                hardikr shah
                                wrote on last edited by
                                #16

                                Hi, I know, but in my application, I have to allow both user to view and same data, but if any of one is deleting the data then I have to give message that this data is deleted by this particular user. And redirect another user to home page. So I have to access, another session user, from current user session. Means if current user is going to delete data, at the same time he can access the another user, who is seeing same data, and he will give message that data is going to be deleted. Thanks Reply·

                                1 Reply Last reply
                                0
                                • D Dev S

                                  I got an idea but it will slow down ur page litlle bit.. use ajax and refresh the dataset after some time say 3 seconds and if it dont find any data there then just display a alert message the record has been deleted.. So it suits ur requirement??

                                  H Offline
                                  H Offline
                                  hardikr shah
                                  wrote on last edited by
                                  #17

                                  Hey thanks for quick reply, but don't we have anything through which we can notify another session of user, through Global.asax Application_start events. I am planning to use Application_start event by defining arraylist. we user is going to view record, data is inserted in this arraylost. then when user is going to delete the page it will check for same data from Application array list. And through it he can find session of that particular user and give message. but i don't know how to give message to another user with out he is not firing any postback event

                                  D 1 Reply Last reply
                                  0
                                  • H hardikr shah

                                    Hi, I know, but in my application, I have to allow both user to view and same data, but if any of one is deleting the data then I have to give message that this data is deleted by this particular user. And redirect another user to home page. So I have to access, another session user, from current user session. Means if current user is going to delete data, at the same time he can access the another user, who is seeing same data, and he will give message that data is going to be deleted. Thanks

                                    D Offline
                                    D Offline
                                    Dev S
                                    wrote on last edited by
                                    #18

                                    As you told me it is not a big deal then just keep log in ur db of current user and the record id viewed by them and update it evrytime they view some another record. When a user try to delete the record it is first checked in the logtable it is being viewed by someone or not. If it is viewed by some one then just return the person name or id as hyperlink. But u hav to make some messaging system in your application to notify the another user about the delete.

                                    H 1 Reply Last reply
                                    0
                                    • H hardikr shah

                                      Hey thanks for quick reply, but don't we have anything through which we can notify another session of user, through Global.asax Application_start events. I am planning to use Application_start event by defining arraylist. we user is going to view record, data is inserted in this arraylost. then when user is going to delete the page it will check for same data from Application array list. And through it he can find session of that particular user and give message. but i don't know how to give message to another user with out he is not firing any postback event

                                      D Offline
                                      D Offline
                                      Dev S
                                      wrote on last edited by
                                      #19

                                      ok it is a pretty difficult task. there is a solution but may its not the be the best one but it will work for u. we reached to the solution that u will get the username of the person viewing the record. then just in some table update a flag for notification with the useraname of viewer. Now add a component in your application that will be called on each page . On that component place a alert message which wil be fired when the flag of the notification table is true. And through ajax get the dataset refreshed after few seconds say 3 sec. Hope now u get the solution... :-D

                                      H 1 Reply Last reply
                                      0
                                      • D Dev S

                                        As you told me it is not a big deal then just keep log in ur db of current user and the record id viewed by them and update it evrytime they view some another record. When a user try to delete the record it is first checked in the logtable it is being viewed by someone or not. If it is viewed by some one then just return the person name or id as hyperlink. But u hav to make some messaging system in your application to notify the another user about the delete.

                                        H Offline
                                        H Offline
                                        hardikr shah
                                        wrote on last edited by
                                        #20

                                        sorry, by mistake i gave you 1 in rating. I want to give message to another user that particular recored is deleted and recirect him/her to Home page, when a User is going to delete a record. So I have to access session(instance) of another user, but I havn't idea, how to access another user at the same time who is viewing same record. Thanks Hardik Shah

                                        1 Reply Last reply
                                        0
                                        • D Dev S

                                          Hi, First point is this how you are going to notify the user who is already watching the deal(until he refreshes the page). So its better lock it while it is viewed by other and for this create a log in ur db in synchronisation with ur Session variable..

                                          D Offline
                                          D Offline
                                          Dev S
                                          wrote on last edited by
                                          #21

                                          ok it is a pretty difficult task. there is a solution but may its not the be the best one but it will work for u. we reached to the solution that u will get the username of the person viewing the record. then just in some table update a flag for notification with the useraname of viewer. Now add a component in your application that will be called on each page . On that component place a alert message which wil be fired when the flag of the notification table is true. And through ajax get the dataset refreshed after few seconds say 3 sec. Hope now u get the solution...

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups