Click here to Skip to main content
15,890,741 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionDynamically added HtmlGenericControl not displayed Pin
Member 1045459216-Dec-13 2:15
Member 1045459216-Dec-13 2:15 
AnswerRe: Dynamically added HtmlGenericControl not displayed Pin
Richard Deeming16-Dec-13 4:10
mveRichard Deeming16-Dec-13 4:10 
GeneralRe: Dynamically added HtmlGenericControl not displayed Pin
Member 1045459216-Dec-13 4:44
Member 1045459216-Dec-13 4:44 
GeneralRe: Dynamically added HtmlGenericControl not displayed Pin
Richard Deeming16-Dec-13 4:48
mveRichard Deeming16-Dec-13 4:48 
GeneralRe: Dynamically added HtmlGenericControl not displayed Pin
Member 1045459216-Dec-13 5:04
Member 1045459216-Dec-13 5:04 
GeneralRe: Dynamically added HtmlGenericControl not displayed Pin
Richard Deeming16-Dec-13 5:14
mveRichard Deeming16-Dec-13 5:14 
GeneralRe: Dynamically added HtmlGenericControl not displayed Pin
Member 1045459216-Dec-13 6:29
Member 1045459216-Dec-13 6:29 
QuestionHow to add on emotion , sound[5 question] in ASP.NET SingnalR Pin
Member 1046826015-Dec-13 22:40
Member 1046826015-Dec-13 22:40 
I don't know how to add on
1.emotion
2.sound[when I send out my message]
3.[time of send out & seen] feature
4.count number of user in room
5.private chat to someone
In bottom that 3 I showed is my class and html in my project

==index.html==
XML
<!DOCTYPE html>
<html>
<head>
    <title>SignalR Simple Chat</title>
    <style type="text/css">
        .container {
            background-color: #99CCFF;
            border: thick solid #808080;
            padding: 20px;
            margin: 20px;
        }
    </style>
</head>
<body>
    <div class="container">
        <input type="text" id="message" />
        <input type="button" id="sendmessage" value="Send" />
        <input type="hidden" id="displayname" />
        <ul id="discussion">
        </ul>
    </div>
    <!--Script references. -->
    <!--Reference the jQuery library. -->
    <script src="Scripts/jquery-1.10.2.min.js"></script>
    <!--Reference the SignalR library. -->
    <script src="Scripts/jquery.signalR-2.0.0.min.js"></script>
    <!--Reference the autogenerated SignalR hub script. -->
    <script src="/signalr/hubs"></script>
    <!--Add script to update the page and send messages.-->
    <script type="text/javascript">

        //Use for check what method I'm using
        $.connection.hub.logging = true;
        $(function () {
            // Declare a proxy to reference the hub.
            var chat = $.connection.chatHub;
            // Create a function that the hub can call to broadcast messages.
            chat.client.broadcastMessage = function (name, message) {
                // Html encode display name and message.
                var encodedName = $('<div />').text(name).html();
                var encodedMsg = $('<div />').text(message).html();

                // Add the message to the page.
                $('#discussion').append('<li><strong>' + encodedName
                    + '</strong>:&nbsp;&nbsp;' + encodedMsg + '</li>');
            };
            // Get the user name and store it to prepend to messages.
            $('#displayname').val(prompt('Enter your name:', ''));
            // Set initial focus to message input box.
            $('#message').focus();
            // Start the connection.
            $.connection.hub.start().done(function () {
                $('#sendmessage').click(function () {
                    // Call the Send method on the hub.
                    chat.server.send($('#displayname').val(), $('#message').val());
                    // Clear text box and reset focus for next comment.
                    $('#message').val('').focus();
                });
            });
        });
    </script>
</body>
</html>


==ChatHub==
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.AspNet.SignalR;

namespace SignalRChat
{
    public class ChatHub : Hub
    {
        public void Hello()
        {
            Clients.All.hello();
        }
        public void Send(string name, string message)
        {
            // Call the broadcastMessage method to update clients.
            Clients.All.broadcastMessage(name, message);
        }
    }
}


==Startup==
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.Owin;
using Owin;
[assembly: OwinStartup(typeof(SignalRChat.Startup))]

namespace SignalRChat
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            // Any connection or hub wire up and configuration should go here
            app.MapSignalR();
        }
    }
}

QuestionDiiference Pin
tsunamigang15-Dec-13 22:36
tsunamigang15-Dec-13 22:36 
SuggestionRe: Diiference Pin
Richard MacCutchan15-Dec-13 22:47
mveRichard MacCutchan15-Dec-13 22:47 
AnswerRe: Diiference Pin
joginder-banger25-Dec-13 16:10
professionaljoginder-banger25-Dec-13 16:10 
QuestionProblem to create webPart dynamically! Pin
hdv21214-Dec-13 5:59
hdv21214-Dec-13 5:59 
AnswerRe: Problem to create webPart dynamically! Pin
hdv21215-Dec-13 1:36
hdv21215-Dec-13 1:36 
QuestionHow can pass a value one form to another from with the help of Java Script?? Pin
joginder-banger13-Dec-13 23:33
professionaljoginder-banger13-Dec-13 23:33 
QuestionUniq 8 digit time stamp Pin
byka12-Dec-13 6:31
byka12-Dec-13 6:31 
AnswerRe: Uniq 8 digit time stamp Pin
Abhinav S13-Dec-13 22:33
Abhinav S13-Dec-13 22:33 
QuestionHow to create reply options on comments? Pin
Member 840570012-Dec-13 2:00
Member 840570012-Dec-13 2:00 
AnswerRe: How to create reply options on comments? Pin
thatraja12-Dec-13 3:26
professionalthatraja12-Dec-13 3:26 
Generalto get the exact answer for the asp.net Pin
Member 1046157211-Dec-13 21:06
Member 1046157211-Dec-13 21:06 
GeneralRe: to get the exact answer for the asp.net Pin
Richard MacCutchan11-Dec-13 21:23
mveRichard MacCutchan11-Dec-13 21:23 
QuestionRe: to get the exact answer for the asp.net Pin
thatraja12-Dec-13 2:59
professionalthatraja12-Dec-13 2:59 
GeneralRe: to get the exact answer for the asp.net Pin
joginder-banger13-Dec-13 23:37
professionaljoginder-banger13-Dec-13 23:37 
GeneralAdding a row in ASP.Net when no records are selected using DetailsView Pin
wc211-Dec-13 5:09
wc211-Dec-13 5:09 
Questionvideo Conferencing in my web application Pin
Sanjeev991810-Dec-13 20:06
Sanjeev991810-Dec-13 20:06 
AnswerRe: video Conferencing in my web application Pin
Snehasish_Nandy10-Dec-13 23:30
professionalSnehasish_Nandy10-Dec-13 23:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.