Click here to Skip to main content
15,885,167 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Is there a way to capture all the page records in jqgrid when exporting to excel Pin
devvvy13-Oct-14 9:32
devvvy13-Oct-14 9:32 
QuestionRegarding Self hosting SignalR Application in Win Service Pin
Tridip Bhattacharjee13-Oct-14 5:20
professionalTridip Bhattacharjee13-Oct-14 5:20 
QuestionHow to embed a video in my c# based dot net website which should be compatible in all browsers especially chrome. Pin
Member 1107698013-Oct-14 1:15
Member 1107698013-Oct-14 1:15 
Questionasp.net web service error "Microsoft.Web.Services3.Security.SecurityFault: Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message." Pin
rafay ansar12-Oct-14 10:32
rafay ansar12-Oct-14 10:32 
AnswerRe: asp.net web service error "Microsoft.Web.Services3.Security.SecurityFault: Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message." Pin
jkirkerx12-Oct-14 11:48
professionaljkirkerx12-Oct-14 11:48 
QuestionHow to use JScript to get mouse position inside image? Pin
Troublesome Tommy10-Oct-14 10:19
Troublesome Tommy10-Oct-14 10:19 
AnswerRe: How to use JScript to get mouse position inside image? Pin
Troublesome Tommy11-Oct-14 6:57
Troublesome Tommy11-Oct-14 6:57 
QuestionSignalR - Jquery response - 304 error Pin
miss78610-Oct-14 4:28
miss78610-Oct-14 4:28 
Dear all,
I am running the following script on the client-side and the script is failing to update, when there is change in the database. I debugged the script using web-browser debugger and discovered my Jquery scripts are responding back as "304 not modified". I am assuming the server code is sending 304 resp. if so, what tests can I carry out, to help me debug server code, to find where the logic maybe going wrong.

Client-side:
C#
 <script src="../Scripts/jquery-1.6.4.js"></script>
 <script src="../Scripts/jquery.signalR-2.1.2.min.js"></script>
 <script src='<%: ResolveClientUrl("~/signalr/hubs") %>'></script>
 <script type="text/javascript">
$(function () {
    // Declare a proxy to reference the hub.          
    var notifications = $.connection.NotificationHub;
    // Create a function that the hub can call to broadcast messages.
    notifications.client.recieveNotification = function (role, descrip) {
        // Add the message to the page.                    
        $('#spanNewMessages').text(role);
        $('#spanNewCircles').text(descrip);            
    };
    // Start the connection.
    $.connection.hub.start().done(function () {
        notifications.server.sendNotifications();
        alert("Notifications have been sent.");

    }).fail(function (e) {
        alert(e);
    });
    //$.connection.hub.start();
});
  </script>
  <h1>New Notifications</h1>
  <div>
  <br />
  New   <span id="spanNewMessages"></span> = role.<br />
  New   <span id="spanNewCircles"></span> = descrip.<br />   
  </div>


The server side code is created signalR hub class and also has sql dependency logic as well:
C#
[HubName("NotificationHub")]
public class notificationHub : Hub
{
    string role = "";
    string descrip = "";

    [HubMethodName("sendNotifications")]
    public void SendNotifications()
    {
        using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["##########"].ConnectionString))
        {

            string query = "SELECT top 1 [role],[description] FROM [dbo].[User] order by uploadDate desc";
            connection.Open();
            SqlDependency.Start(GetConnectionString());

            using (SqlCommand command = new SqlCommand(query, connection))
            {

                try
                {
                    command.Notification = null;
                    DataTable dt = new DataTable();
                    SqlDependency dependency = new SqlDependency(command);
                    dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
                    if (connection.State == ConnectionState.Closed)
                        connection.Open();
                    var reader = command.ExecuteReader();
                    dt.Load(reader);
                    if (dt.Rows.Count > 0)
                    {
                        role = dt.Rows[0]["role"].ToString();
                        descrip = dt.Rows[0]["description"].ToString();

                    }

                    connection.Close();

                }

                catch (Exception ex)
                {
                    throw ex;
                }
            }  
        }

        Clients.All.RecieveNotification(role, descrip);
    }

    private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
    {
        if (e.Info == SqlNotificationInfo.Insert)

        {
            notificationHub nHub = new notificationHub();
           nHub.SendNotifications();

        }
    }


Any hints would be very much appreciated. Many thanks
QuestionHow to sms through asp.net website on mobile Pin
Harishankar Maurya9-Oct-14 19:21
Harishankar Maurya9-Oct-14 19:21 
AnswerRe: How to sms through asp.net website on mobile Pin
Mahinuddin11-Oct-14 1:53
Mahinuddin11-Oct-14 1:53 
QuestionGetting error while running Pin
Member 111411249-Oct-14 3:50
Member 111411249-Oct-14 3:50 
AnswerRe: Getting error while running Pin
Richard Deeming9-Oct-14 6:59
mveRichard Deeming9-Oct-14 6:59 
QuestionHow to maintain scroll position in chrome in Asp .Net Pin
Member 98439578-Oct-14 18:52
Member 98439578-Oct-14 18:52 
AnswerRe: How to maintain scroll position in chrome in Asp .Net Pin
Dominic Burford10-Oct-14 0:39
professionalDominic Burford10-Oct-14 0:39 
GeneralRe: How to maintain scroll position in chrome in Asp .Net Pin
Member 984395710-Oct-14 0:44
Member 984395710-Oct-14 0:44 
Questionregex replace with double quote Pin
jkirkerx8-Oct-14 13:30
professionaljkirkerx8-Oct-14 13:30 
AnswerRe: regex replace with double quote Pin
Richard Deeming9-Oct-14 1:47
mveRichard Deeming9-Oct-14 1:47 
GeneralRe: regex replace with double quote [EDIT] fixed my regex Pin
jkirkerx9-Oct-14 8:05
professionaljkirkerx9-Oct-14 8:05 
QuestionGreybox popup not show properly after postback Pin
Member 98439577-Oct-14 19:35
Member 98439577-Oct-14 19:35 
QuestionPiro box add two iframe after asynchronous postback. Pin
Member 98439576-Oct-14 21:00
Member 98439576-Oct-14 21:00 
QuestionGray box not working after Asynchronus postback Pin
Member 98439576-Oct-14 20:54
Member 98439576-Oct-14 20:54 
QuestionButton click not trigger second time in jquery Modal popup Pin
dineshkanagaraj6-Oct-14 3:31
dineshkanagaraj6-Oct-14 3:31 
AnswerRe: Button click not trigger second time in jquery Modal popup Pin
jkirkerx6-Oct-14 11:46
professionaljkirkerx6-Oct-14 11:46 
QuestionWant to send message to only connected client SignalR Pin
Tridip Bhattacharjee5-Oct-14 21:05
professionalTridip Bhattacharjee5-Oct-14 21:05 
QuestionLog-in form question Pin
Member 87616674-Oct-14 8:46
Member 87616674-Oct-14 8:46 

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.