0 Replies - 4855 Views - Last Post: 30 July 2012 - 05:36 AM Rate Topic: -----

#1 MikeyV  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-May 12

Live Chat - Instant Messaging Help

Posted 30 July 2012 - 05:36 AM

I have this chat module I created that is a Web user Control where users can speak with an admin/operator and the admin/operator can switch between users in a list to speak to. Current I am trying to create a way for the admin to be able to open there chat in a separate window so that they can see multiple conversations they are having at once. To do this I have to user page specific variables that are set during initial load and do not change during postback. I have tried the following using viewstate, but the viewstate variables change during postback.

This is the javascript used to open a new window with the currently selected chat.
$('#dvDetach').click(function() {

        window.open('/controls/livechat/detachedchatbox.aspx','_blank', 'width=422,height=422');

this is the vb.net code that is suppose to Set the viewstate variable on initial load and not change during client postback.
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Me.EnableViewState = True

        If Not Page.IsPostBack Then

            If ViewState("id") Is Nothing AndAlso ViewState("guestID") Is Nothing Then

                ViewState("id") = Session("id")

                ViewState("guestID") = Session("guestID")

            End If

        End If

        ClientScript.RegisterStartupScript(Me.GetType, "TestAlert", "alert('" & ViewState("id").ToString & ":" & ViewState("guestID").ToString & "');", True)

    End Sub

Is This A Good Question/Topic? 0
  • +

Page 1 of 1