Problem with Bootstrap and bundle in ASP.NET Core - asp.net-core

I use Visual Studio 2017, I downloaded the Bootstrap package but I have no idea what should I do next. I am using bundle file and package...
What should I do?
Also I downloaded a file from get bootstrap website but I don't know how to compile it!

The first way is to copy the css and js file to wwwroot/lib folder in your project.
The second way is to use BootstrapCDN if you want to skip the download.
A better way of using bootstrap in asp.net core project is to use LibMan(To be able to use LibMan you should have VS 2017 version 15.8 or higher.):
1.In Solution Explorer, right-click the project folder in which the files should be added. Choose Add > Client-Side Library. The Add Client-Side Library dialog appears:
2.Select the jsdelivr provider from the Provider drop down.
3.Type the library name to fetch in the Library text box.
4.Specify the project folder for storing the files in the Target Location text box.
5.Cilck Install button.
Then you could use the following code to reference the boostrap:
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
Note: As mentioned on the download site, this does not include jQuery, so if you want to use jQuery, you need to download that separately.

Related

i didnot find my bootstra. min.css file in my dist folder?

i download bootstrap 4 version for web development but in node_modules>bootstrap>dist>CSS> bootstrap.min.CSS is not there and in the online trainer link this file with html so what file i select to linked
I'am afraid you may have downloaded the wrong one. Have you downloaded from the official bootstrap site:
https://getbootstrap.com/docs/4.0/getting-started/download/
You will find the file in the folder css > bootstrap.min.css
You can copy that and put it in the project you are working on.

Sitefinity CSS combining in MVC Layouts

In Sitefinity WebForms you have a ResourceLinks control allowing you to combine multiple, but what do you use in MVC layouts?
I'm not sure if the razor helper #Html.StyleSheet will do the job?
Adding all the CSS files to the Global folder in App_Data\Sitefinity\WebsiteTemplates[template_folder]\App_Themes[theme] will automatically add them to the site, but won't combine them.
We're working with Sitefinity 8.x and looking for a definitive way to compress and combine JS and CSS, but the pickings seem slim.
With the move from webforms to mvc, Sitefinity didn't include specifically introduce a new bundler or something so you're left with essentially 2 default options, but they've seemed to have opted for approach #3.
1) Use .less and .sass to pre-process as part of your build process.
So in your theme folder you would have a global.less (or scss or sass) that essentially combines them using the #import directive.
Install a VisualStudio extension like Mad's Kristensen Bundler and Minification VS Extension (previously part of WebEssentials) and then define in the VS settings that it should compile and minify on build.
Then every time you build or publish, your one bundled-and-compressed .min.css will be available for Sitefinity.
2) Second option would be to use default ASP.NET Web Optimization.
Where you define static bundles in VisualStudio and then use these bundles by means of #Styles.Render or #Scripts.Render to output them.
3) Lastly a new way has been added with the new Feather approach, which uses the current fashionable approach of Grunt to bundle and optimize your styles and scripts.
In the /ResourcePackages folder you'll already see a gruntfile.js file which has a task you can run which can then compile (and can be extended to prefix, bundle, minify, etc) your .sass into a .min.css which you can then add to your solution.
A sample can be seen here (https://github.com/Sitefinity/feather-packages/blob/master/Bootstrap/gruntfile.js)
I'd use a combination of the above approach to receive the maximum result with Sitefinity where you use option 1 to have VS build out your core/base CSS and JS and then include them using Web.Optimization.
Any additional page or widget related styles or JS can then be included afterwards manually through the css widget which gets compiled through option number 3.
Once you get more familiar with this new approach you can create and load optimized .css and .js on demand - even using a RequireJS approach to load them depended on the widget dragged and dropped on the page. RequireJS might seem out-dated given the latest gadgets and gizmo's but with v9.0 its still being used by Sitefinity itself to add inline-editing functionality.
Let me know if you need more info on option 3, I'm happy to extend my answer with some code snippets, or sample scripts on how I've tailored them.

DNN Content slider module not working

I am using DNN 8 and i need slider for the home page. I have did extensive search about this on internet and i found Content Slider module.
I have added this module in the page and when i add content slider module a message appears in the pane like below
No content sliders have been created yet. Please use the Actions Menu
to create a slider.
So i used action menu to add slider, when i click Add Slider option from the action menu i get the error like below image.
Click image to see error
Not understanding what to do. So please any help me to solve this error.
This is a bug related to DNN8 deprecating support for older controls. If the module is open source you should download the source code and add references to DNN8 so that you can recompile it to get the proper references.
Steps:
Setup your development environment (link)
Download Source Code (_source) version of the module
Install _Source package via the Host/Extensions page (link)
Open the CSProj file in Visual Studio 2015
Remove reference to DotNetNuke.Web
Add reference to DotNetNuke.Web.Deprecated (found in the website's BIN folder)
Compile in Release mode to package (assuming the module supports my BUILDSCRIPTS)
Install the created _INSTALL file to your production DNN site
If the module doesn't use my BUILDSCRIPTS just compile and copy the DLL generated to your production website BIN folder
Chris

bootstrap-responsive.min.css not found in bootstrap nuget package

The bootstrap-responsive.min.css file is not found in the bootstrap nuget package.
Even though CDN is available for the file, I'm using MVC and want to bundle the local file.
Where can this file be found?
bootstrap-responsive.min.css is a Bootstrap v2.x.x-specific file.
It no longer exists in Bootstrap v3.x.x because Bootstrap v3.x.x is responsive by default.

Howto modify Sandcastle presentation style without changing the default installation files

My project uses Sandcastle and Sandcastle Help File Builder to generate documentation.
We're using a customized version of script_manifold.js that persists the user's language preference across pages (the default version resets the language preference with each page).
Currently, the script is located in the Sandcastle\presentation\VS2005\scripts folder.
Is there a way to override this script with a custom version, without having to mess with the Sandcastle installation? That is, can I have a file that is checked into source control along with my source code, and somehow have that file used by SHFB instead of the default Sandcastle one?
Never mind, I found the answer!
In the SHFB project explorer window, you can just create a folder with the same name as the presentation style content you wish to override. This works with any stock content, such as HTML, CSS or JS files. So in my situation, I needed to override the script_manifold.js file which lives in the Scripts folder of the VS2005 presentation style.
So I needed to create a folder called Scripts in my SHFB project, then put my script_manifold.js in that folder.
It all works perfectly. Excellent!