Chat Control

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
10/8/2010 2:29:45 PM
Gravatar
Total Posts 76

Re: Chat Control

Hello Joe / Neilc,

So how is the module written?

I have this. When i put the control on my website nothing is shown? Any help?

 

<%@ Control Language="C#" ClassName="ChatControl.ascx" %>

<%@ Register Assembly="ChatControl" Namespace="ChatControl" TagPrefix="cc1" %>


<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{

if (Request.IsAuthenticated)
{
WebChat2.UserName = HttpContext.Current.User.Identity.Name;
}
else
{
WebChat2.Visible = false;
}

}

</script>


<cc1:WebChat ID="WebChat2" runat="server" CallBackInterval="4" ChatTopic="Cooking" HistoryCapacity="20" Height="245px" Width="490px" />

 

 

THNX..........
 

10/8/2010 3:02:11 PM
Gravatar
Total Posts 76

Re: Chat Control

Hello,

Solved it. Removed the line "WebChat2.Visible = false;"

Is it possible to make it that only people who are logged in are able to chat?
 

9/9/2011 4:39:03 AM
Gravatar
Total Posts 76

Re: Chat Control

Hello,

I put this code in my custom feature:

protected void Page_Load(object sender, EventArgs e)
        {
           
            if (!IsPostBack)
            {
                ChatcontrolZien.Visible = true;

                if (Request.IsAuthenticated)
                {
                    WebChat2.UserName = HttpContext.Current.User.Identity.Name;
                }
                else
                {
                    WebChat2.Visible = false;
                }
            }

            LoadSettings();
            PopulateLabels();
            PopulateControls();

        }

This code worked fine in a custom module but i now implemented it as a custom feature.

The problem now is that when i login everything goes well except that when i type text the text doesn't display, only when i leave the page and re-enter the page than i can type text and it gets shown.

Don't know where to look for the solution, tried refreshing page, no luck.

Any help?! Thnx

9/9/2011 9:27:06 AM
Gravatar
Total Posts 18439

Re: Chat Control

Hi Hanzie,

If your chat control does postback then you probably need to move this code:

if (Request.IsAuthenticated)
                {
                    WebChat2.UserName = HttpContext.Current.User.Identity.Name;
                }
                else
                {
                    WebChat2.Visible = false;
                }

so that it is not inside a check for IsPostback because it needs to set that also on postbacks

I don't know what you mean by it works for custom module but not for custom feature, those are the same thing to me.

The best thing to do is to set breakpoints in your code and step through it to find out if things are happening as you expect them or not.

Hope that helps,

Joe

9/15/2011 11:57:02 AM
Gravatar
Total Posts 76

Re: Chat Control

Hello Joe,

I see now there is no problem! When i upload the feature everything works fine.


 

THNX

You must sign in to post in the forums. This thread is closed to new posts.