ASP.Net MVC project with office ui fabric react - node.js

We are trying to build a sample application with asp.net MVC using office ui fabric react. Followed the the below steps from node js command prompt as mentioned here.
By following the steps I could get the normal react sample working. I tried to add the fabric UI label code as given below in index.tsx file and then running the application, but fabric react label component is not getting rendered in the browser.
index.tsx code:
/* tslint:disable:no-unused-variable */
import * as React from 'react';
/* tslint:enable:no-unused-variable */
import { Label } from 'office-ui-fabric-react/lib/Label';
export const LabelBasicExample = () => (
<div>
<Label>I'm a Label</Label>
<Label disabled={ true }>I'm a disabled Label</Label>
<Label required={ true }>I'm a required Label</Label>
</div>
);
After adding this code ran webpack from nodejs command prompt and then tried browsing my index.html which has the below code. But could not see the react component getting rendered and neither I get any error.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello React!</title>
</head>
<body>
<div id="example"></div>
<!-- Dependencies -->
<script src="./node_modules/react/umd/react.development.js"></script>
<script src="./node_modules/react-dom/umd/react-dom.development.js"></script>
<!-- Main -->
<script src="./dist/bundle.js"></script>
</body>
</html>
Can someone help here on is there any additional step that I am missing here or guide me to have the fabric react component working with asp.net.
Thanks

Related

How to allow cross-origin access for Outlook Web Add-In

I developed a Outlook Web Add-in using Visual Studio 2017, and so far all my testing is based on hosting the Add-in from localhost, and I had no issues with that, everything worked fine. Now, I moved my Add-in to a shared folder on my Sharepoint server, so that others can test my Add-in.
Within my manifest file, I changed the line which defines the URL of my function file to point to where it is hosted:
<FunctionFile resid="FunctionFile.Url" />
I also added in a line under
<AppDomain>https://<My URL Domain></AppDomain>
The image of my add-in icon loads find, however when I click on my add-in icon from my OWA page, I get the following error:
SEC7120: [CORS] The origin 'https://' failed to allow a cross-origin document resource at 'ms-appx-web:///assets/errorpages/forbidframingedge.htm#https:///Functions/FunctionFile.html?et='.
Is there any way to allow my add-in to run? I'm currently doing my testing on the Edge Browser.
Thanks!
Update:
Here's my function file html code:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title></title>
<script src="../Scripts/jquery-3.3.1.min.js" type="text/javascript">
</script>
<script src="../Scripts/Office/MicrosoftAjax.js" type="text/javascript">
</script>
<script src="../Scripts/Office/1/office.js" type="text/javascript">
</script>
<script src="FunctionFile.js" type="text/javascript"></script>
</head>
<body>
<!-- NOTE: The body is empty on purpose. Since this is invoked via a button, there is no UI to render. -->
</body>
</html>

Djaty - What is the `djatyReqId` that's being sent with all ajax requests?

I have installed Djaty JS SDK normally as the following:
<!DOCTYPE html>
<html lang="en">
<head>
<!-- ... -->
<script src="djaty.min.js" djaty-api-key="djaty-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">
</script>
<!-- ... -->
</head>
<body>
<!-- ... -->
</body>
</html>
It works now successfully and I start receiving my first test errors.
I just wonder, what is the djatyReqId that's being sent with all ajax requests sent from my application?
Djaty will be able to link the bugs coming from frontend and backend together by sending this djatyReqId with every Ajax request.
For example, if an Ajax request causes a (5xx) failure at the server side, two bugs will be created - One from the frontend SDK (That has the end user activities and logs) and another from the backend SDK.
Using djatyReqId, Djaty knows that those bugs are related to each other and - At the dashboard - will show the Ajax timeline item with a "Backend Timeline" tab to help you debug what was happening at the server side during this Ajax was sent.

How to import Material Design Components into Progressive Web App Starter Kit?

I want to use Material Design Component: Lists into my Progressive Web App Starter Kit.
So...
npm install #material/list
Now what?
All I can think to do is
import { MDCList } from '#material/list/dist/mdc.list.css'
or
<link rel="stylesheet" href="/node_modules/#material/list/dist/mdc.list.css"/>
Both produce errors. What should I do?
You can download the materialize css and js files at keep it at the root level of the project folder
then in the app.js (your entry point file)
html`
<link rel="stylesheet" href="./styles/materialize.min.css" />
<script type="text/javascript" src="./js/materialize.min.js"></script>
<div> Your content here..</div>
`
give the path according to the folder you have created

bootstrap full year calendar setup

I'm trying to get this package http://www.bootstrap-year-calendar.com up and running. I've got nodeJS installed, have grabbed the package with npm and have setup an html page as per the usage instructions, but I cannot actually get the calendar to render. This is my first foray into nodejs, so I suspect I'm missing something straightforward. Any ideas on what the problem might be?
Thanks as always. My html/js currently looks like this:
<html>
<head></head>
<body>
<script src="./jquery/dist/jquery.js"></script>
<script src="./bootstrap/dist/js/bootstrap.js"></script>
<script src="./bootstrap-year-calendar/js/bootstrap-year-calendar.min.js"></script>
<script>
$('.calendar').calendar()
</script>
</body>
</html>

Kendo setup on mvc4 vs2012

How can i setup kendo ui with mvc4. I want use its themas and grid and all controls in my web application.
I have use http://demos.kendoui.com/themebuilder/web.html but how do i apply generated themas in my website. I am little bit confused with kendo, I am new with it. Please suggest me how can I configure kendo on mvc4 and use its all functionality.
Using : - MVC 4 , html 5 and c#
Thanks!!
How can i setup kendo ui with mvc4
In exactly the same way you would set it up with PHP. Or with a Java Servlet. KendoUI is a client side framework which is server side agnostic. It doesn't matter which server side technology you are using.
I want use its themas and grid and all controls in my web application.
Great, go ahead. Head over to the documentation, read it, roll up your sleeves and integrate into your application.
Create a new ASP.NET MVC 4 application using the Empty template
Add a HomeController to serve up a view:
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
}
And of course a corresponding ~/Views/Home/Index.cshtml view:
#{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<link rel="stylesheet" href="//cdn.kendostatic.com/2012.2.710/styles/kendo.common.min.css" />
<link rel="stylesheet" href="//cdn.kendostatic.com/2012.2.710/styles/kendo.default.min.css" />
</head>
<body>
<input id="dropDownList" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="//cdn.kendostatic.com/2012.2.710/js/kendo.all.min.js"></script>
<script type="text/javascript">
$("#dropDownList").kendoDropDownList({
dataTextField: "text",
dataValueField: "value",
dataSource: [
{ text: "Item1", value: "1" },
{ text: "Item2", value: "2" }
]
});
</script>
</body>
</html>
As you can see there's absolutely nothing MVC specific here. You could have served this markup from any server side framework. All you need is pick a theme, reference it from the Kendo CDN, reference the Kendo scripts at the end of your DOM from the CDN and start playing with it.
But the most important thing if you want to have some progress is to RTFM where the guys from Telerik (and colleagues of mine) have spent a lot of time to documenting everything you need to know.
There is a tutorial on the Kendo Docs site that will walk you through it step by step.
Hello Kendo UI - Add Kendo UI
and
Kendo Music Store - Project Setup

Resources