Click here to Skip to main content
15,888,253 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: JQuery Not Found Pin
Kevin Marois2-Mar-17 10:29
professionalKevin Marois2-Mar-17 10:29 
GeneralRe: JQuery Not Found Pin
Sander Rossel2-Mar-17 10:32
professionalSander Rossel2-Mar-17 10:32 
AnswerRe: JQuery Not Found Pin
ZurdoDev2-Mar-17 10:16
professionalZurdoDev2-Mar-17 10:16 
GeneralRe: JQuery Not Found Pin
Kevin Marois2-Mar-17 10:16
professionalKevin Marois2-Mar-17 10:16 
GeneralRe: JQuery Not Found Pin
ZurdoDev2-Mar-17 10:18
professionalZurdoDev2-Mar-17 10:18 
GeneralRe: JQuery Not Found Pin
Kevin Marois2-Mar-17 10:28
professionalKevin Marois2-Mar-17 10:28 
GeneralRe: JQuery Not Found Pin
ZurdoDev2-Mar-17 10:29
professionalZurdoDev2-Mar-17 10:29 
QuestionMy First JavaScript Code - Exception Pin
Kevin Marois2-Mar-17 7:18
professionalKevin Marois2-Mar-17 7:18 
First, this is my first ever attempt ay writing JavaScript, so forgive my ignorance...

My app is listening to a SignalR service. When the server hub calls "NotifyAllClientsOfChanges" I want my WebGrid to be reloaded. I'm getting an exception.

1) The Controller code:
public class HomeController : Controller
{
    private IDataAccess _dal;
    private DashboardClientProxy _dashboardProxy;
    public HomeController()
    {
        _dal = new DataAccess();
        _dashboardProxy = new DashboardClientProxy();

        try
        {
            _dashboardProxy.Connect();
        }
        catch (Exception e)
        {
            throw e;
        }
    }
    public ActionResult Index()
    {
        var data = GetData();
        return View(data);
    }
    public IEnumerable<AssayDashboardInfoEntity> GetData()
    {
        var data = _dal.GetDashboardInfos(new DashboardInfoQueryArgs());
        return data;
    }
}

2) Next my JS code.
<script language="javascript">
    $(function () {

<pre>
    proxy.client.NotifyAllClientsOfChanges = function () {

        var searchUrl = "Home/GetData";

        $.ajax({
            url: searchUrl,
            type: "POST",
            success: function (data) {
                $("#divData").html(data);
            }
        });
    };
});</pre>

3) When I run it I get
var searchUrl = "Home/GetData";

$.ajax({
    url: searchUrl,
    type: "POST",
    success: function (data) {
        $("#divData").html(data);
        $("#btnSearch").attr({ 'value': 'Search' });
    }
});

Unhandled exception at line 59, column 5 in http://localhost:49467/Home/Index
0x800a1391 - JavaScript runtime error: '$' is undefined

Someone please help. What am I doing wrong???

Line 59 is the "$(function () {" line
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.


modified 2-Mar-17 13:44pm.

AnswerRe: My First JavaScript Code - Exception Pin
Sander Rossel2-Mar-17 8:03
professionalSander Rossel2-Mar-17 8:03 
GeneralRe: My First JavaScript Code - Exception Pin
Kevin Marois2-Mar-17 8:14
professionalKevin Marois2-Mar-17 8:14 
GeneralRe: My First JavaScript Code - Exception Pin
Afzaal Ahmad Zeeshan2-Mar-17 8:21
professionalAfzaal Ahmad Zeeshan2-Mar-17 8:21 
Questionwhite Popup show while calling wpf app(made on win-07) by Thirdparty app(Made on Xp service pack -3) on windows 7 Pin
Member 1227019516-Feb-17 19:51
Member 1227019516-Feb-17 19:51 
AnswerRe: white Popup show while calling wpf app(made on win-07) by Thirdparty app(Made on Xp service pack -3) on windows 7 Pin
Richard MacCutchan16-Feb-17 21:42
mveRichard MacCutchan16-Feb-17 21:42 
QuestionList of CheckBoxes Localization not working Pin
Member 1300292515-Feb-17 5:33
Member 1300292515-Feb-17 5:33 
Questionstill shown DialogService until error exists in user input and dont press Cancel Pin
MrKBA7-Feb-17 21:14
MrKBA7-Feb-17 21:14 
AnswerRe: still shown DialogService until error exists in user input and dont press Cancel Pin
Richard Deeming8-Feb-17 2:04
mveRichard Deeming8-Feb-17 2:04 
GeneralRe: still shown DialogService until error exists in user input and dont press Cancel Pin
MrKBA8-Feb-17 21:20
MrKBA8-Feb-17 21:20 
GeneralRe: still shown DialogService until error exists in user input and dont press Cancel Pin
Richard Deeming8-Feb-17 21:53
mveRichard Deeming8-Feb-17 21:53 
GeneralRe: still shown DialogService until error exists in user input and dont press Cancel Pin
MrKBA8-Feb-17 22:10
MrKBA8-Feb-17 22:10 
GeneralRe: still shown DialogService until error exists in user input and dont press Cancel Pin
Richard Deeming8-Feb-17 22:16
mveRichard Deeming8-Feb-17 22:16 
GeneralRe: still shown DialogService until error exists in user input and dont press Cancel Pin
MrKBA8-Feb-17 23:47
MrKBA8-Feb-17 23:47 
GeneralRe: still shown DialogService until error exists in user input and dont press Cancel Pin
Richard Deeming9-Feb-17 0:00
mveRichard Deeming9-Feb-17 0:00 
GeneralRe: still shown DialogService until error exists in user input and dont press Cancel Pin
MrKBA9-Feb-17 1:41
MrKBA9-Feb-17 1:41 
QuestionWPF: DataGridCheckboxColumn when one checkbox is checked, check another checkbox in same row Pin
Mark McArdle6-Feb-17 3:04
Mark McArdle6-Feb-17 3:04 
AnswerRe: WPF: DataGridCheckboxColumn when one checkbox is checked, check another checkbox in same row Pin
Richard Deeming6-Feb-17 7:55
mveRichard Deeming6-Feb-17 7:55 

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.