.NET Framework (pronounced dot net) is a software framework developed by Microsoft that runs primarily on Microsoft Windows. ... (As such, computer code written using .NET Framework is called "managed code".)
Problem:
When i open my proejct getting error Could not load file or assembly Newtonsoft.Json, Version=13.0.0.0
Solution:
Your proejct have diffrent versin ofNewtonsoft, just keep same for all projects
or quick way is upate them.
if youre facing a problem like if DateTime is not bind in the Edit Mode You can Use The below way :
@Html.TextBoxFor(model = model.CreatedDate, @{0:yyyy-MM-dd}, new { @class = form-control , @type = date})
it works for me!!
System.IO.DirectoryNotFoundException: Could not find a part of the path for rdlc report error
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.Dire
solution the application requires that assembly microsoft.reportviewer.processingObjectModel version 9.0.0.0 be installed in the global assembly cache first
Navigate to the main project within your solution (usually the default or startup project). Right-click on it an
How to perform encprtion using RijndaelManaged
How to perform encprtion using RijndaelManaged:
To perform encryption using the RijndaelManaged class in C#, you can follow these steps:
Instantiate RijndaelManaged: Create an instance of the RijndaelManaged clas
The .NET Framework is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure until being superseded by the cross-platform .NET project.
To export data from an inquiry table to an Excel sheet using ASP.NET MVC and C#, you can follow these steps:
Step 1: Create a method in your controller that retrieves the inquiry data from your database or any other source. Lets assume your method is called GetInquir
UGC-NET stands for University Grants Commission National Eligibility Test. It is a national-level examination conducted in India to determine the eligibility of candidates for the posts of Assistant Professors and for Junior Research Fellowship (JRF) in Indian universit
Introduction:
Net worth is a concept often associated with individuals or entities and reflects their financial standing. However, for an AI language model like myself, the notion of net worth takes on a different meaning. In this article, we will explore the concept
Save the URL on which a user currently browseseach time from the whole website.
Here are somestep-by-step processon how to implement the example using an action filter to log the URL in an ASP.NET MVC application:
Step 1: Create the LogUrlAttribute class
Create a
how to set session value from cookies if session is expired
Step 1
Set value to cookies
// Create a new cookie
HttpCookie cookie = new HttpCookie(AppConstant.LoggedInCookies.ToString());
// Set the value of the cookie
cookie.Val
openVisual Studio 2022installer.
Next, navigate the theIndividual Componentstab.
You can either search, or you can scroll down and find the following:.
Net Framework project and item templates. T
his is the component that you are missing.
VS 2022 issu
I want to consum api in .net, which client is best and fast to consume api.
several options for consuming APIs in .NET, and the choice of client depends on your specific needs and requirements. Here are some popular choices:
HttpClient: This is a built-in .NET c
How to send PDF as email attachment in asp.net mvc C#
Controller code:
using ServiceProvider.EF;
using ServiceProvider.WebUI.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ServicePro
use dapper in asp.net mvc #
Dapper is a popular micro-ORM (Object-Relational Mapping) library for .NET that allows you to perform efficient and fast database operations with minimal overhead. Heres an example of how you can use Dapper in an ASP.NET MVC project:
create appointment booking page with available time slot using database ms sql server
To create an appointment booking page with available time slots using MS SQL Server, you can follow these general steps:
Create a database table to store appointment i
Display Date in edit mode in asp.net mvc
1- In database table data type is Date e.g date_invoice
2- in DTO or class property is as below
public DateTime date_invoice { get; set; }
3- in html view html is like this
@Html.TextBoxFo
In C#, you can use the FileSystemWatcher class to monitor a directory for changes. Here is an example of how to use the FileSystemWatcher class to monitor a directory and handle changes:
using System;
using System.IO;
class DirectoryWatcher
{
static voi
How to submit form on dropdown change using jQuery
Step 1
- HTML code
@using (Html.BeginForm(Index, Dashboard))
{
@Html.DropDownListFor(model = model.vendor_id, new SelectList((System.Collections.IEnumerable)TempData[vendorslist], vendor_id, name
Best practice to create CRUD in asp.net MVC 5 using jQuery
Java Script
HTML
C# Code
Java Script Code
function AddDiagnosis(id) {
if (id 0) {
$.get(/Diagnosis/CrudDiagnosis, { id: id }, function (data)
Asp.Net Core is a powerful and versatile open-source web framework that enables developers to create modern, dynamic applications for the web. Developed by Microsoft, Asp.Net Core allows developers to build websites and services with .NET in an efficient manner while ta
[solved] Show data in grouping in winforms datagrid view
below is very usefull URL.
https://www.codeproject.com/Tips/995958/DataGridViewGrouper
this is custom control, you can just download and add refrence and use it.
set cell value from session and Eval in asp.net
set cell value from session and Eval in asp.net
value=%# Eval(Price).ToString() == 0.00 ? Session[sf] : Eval(Price) %
asp.net web forms
asp.net repeater
How to add Group by in report with sum in RDLC report in visual studio
- Right click on the middle of the row of the port table
-Right click and choose add group
-on Icon- choose the column on which you want to group and choose option show footer
-merge the
Problem:
when we are using jQuery - some time page take time to load- so to make user busy, we need to display some mesage or icon, that is called as Block UI.
Solution:
its very simple you just need to add 2 lines in your layout page and job is done.
Ad
Steps to create report in visual studio
Copy Existing reports or right click the folder and and choose item you can choose simple report or you can create report from the wizard.
Rename the copied reports
when you will copy the reports - ites related data set
Add Microsoft Access Database Engine 2010 as a prerequisite in Setup project - C#
Download Microsoft Access Database Engine 2010 Redistributable Package from URL = https://www.microsoft.com/en-us/download/details.aspx?id=13255
1- Create Folder folder on your d
Problem:
when we publish website using Visual Studio, we are getting following erros.
publish has encountered an error Object reference not set to an instance of an object A diagnostic log has been written to following location
Change the target location in pub
Convert Numbers To Words In asp.net C#
Problem:
sometimes, we display amount on website like this Price: 14,750000 RS, it is very difficult to read,
so we write it in words , its very meaningful like Fourteen Lac and fifty thounds.....
below is some code
Learn about the .NET platform that powers C# applications
The .NETFramework (pronounced as dotnet) is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows.
What is .NET?
Formally, .NET is an open source developer
has exceeded the allotted timeout of 00:01:00
Problem:
I am using web service in my website, when I debug the code in my website and web service.
I get error opertion time out, error message is ...has exceeded the allotted timeout of 00:01:00
Solution:
How to Install missing component in visual Studio?
in search bar of Windows 10
type Visual Studio Installer
Choose VS Version
and run it, then you can see Installed version Visual Studio. click on Modify and install your missing components
Difference Between svc and asmx.
ASMX defines web services called by an Active Server Page (.ASP file)
SVC, or .svc, is a computer file extension utilized by Microsofts Windows Communication Foundation to symbolize a service hosted by Internet Information Services
how to call wcf in postman?
in app.config change service name=GettingStartedLib.WeatherService
project name+service name
line# endpoint address= binding=basicHttpBinding contract=GettingStartedLib.IWeather
change bnding and contract name
line# 23 add base
1- Date Time Formatting using CONVERT
You can use the CONVERT function to cast a datetime datatype to a formatted string.
SELECT GETDATE() AS [Result] -- 2016-07-21 07:56:10.927
You can also use some built-in codes to convert into a specific format. Here are t
The provided URI scheme http is invalid; expected https. vbCrLf Parameter name: via. solution
in web.config change
security mode=Transport/
to
security mode=None/
Deployment error on IIS This configuration section cannot be used at this path
Solution
Some servies of IIS are not enabled, if you installed .net version those are enabled. so below are the steps to enable them.
Heres what worked for me, had a s
First div and give id footer:
div id=footer
This is footer
/div
this is css:
#footer
{
background-color:red;
position:fixed;
bottom:0px;
left:0px;
right:0px;
height:50px;
margin-bottom:0px;
}
1)First Create tables
2)In controllr write this code
public class AddressController : Controller
{
ContactInfoEntities db = new ContactInfoEntities();
public ActionResult Index()
{
ListCountry CountryList = db.Countries.ToList();
In Itableservices
void UpdateProductViews(int proId);
in tbaleservice
public void UpdateProductViews(int proId)
{
try
{
using (DbContext context = new saudiphonedbEntities())
{
context.Database.ExecuteSqlCommand(U
how to Start working asp.net core mvc
Solution
Start working asp.net core following nugets are required
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Design
Microsoft.EntityFrameworkCore.Tools
Micros
How to add ckeditor in asp.net mvc?
Solution
1) Copy CkEditorFolder
2) Add refrence of Js file
script src=../../ckeditor/ckeditor.js/script
3) in html view add control e.g
textarea class=form-control name=BriefDescription id=BriefDescription rows=3
1) In cache key item
public const string MostViewedProduct = MostViewedProduct;
2) In IproductService
IEnumerableProduct_LookUp_MostViewedProductList_Result GetProductListByMostViewedProducts(Boolean useCache);
3) In product service
public IEnumer
a href=@Url.RouteUrl(sellerproductsdetails, new { controller = Product, action = UcProductListByClientID, catid = seller, id = @item.ClientName.ToSeoUrl() + - + @item.ClientID })
public ActionResult UcProductListByClientID(string id )
{
// take only 4
modified the DBcontext
public class WeedingContext : DbContext
{
public WeedingContext()
: base(WeddingDb)
{
}
.
.
.
.
.
by add in new code for the DBContect to extent the SQLServer timeout
public class WeedingContext : DbContext
{
public W
Use this to show date or time as you want?
var dateTimeNow = DateTime.Now; // Return 00/00/0000 00:00:00
var dateOnlyString = dateTimeNow.ToShortDateString(); //Return 00/00/0000
Regards:Zaif Ullah
1- Make action for crud in any controller.
public ActionResult CrudCustmor()
{
return View();
}
2- Add its view and insert the following code in it.
@model IVR.EF.CUSTOMER
@{
ViewBag.Title = ;
Layout = ~/Views/Shared/_Layout_Admin.cshtml;
What are types of the API
SOAP: Web APIs such as Simple Object Access Protocol (SOAP)
RPC: Remote Procedure Call (RPC) JSON-RPC and XML-RPC
REST: most popularat least in name Representational State Transfer (REST)
api is used to communicate from softwar
The following steps demonstratehow to select multiple rows in grid.
1) Set selectable mode to multiplein the options of the grid.
$(#rowSelection).kendoGrid({
dataSource: {
how to debug performance issue in asp.net mvc
Profile and debug your ASP.NET MVC app with Glimpse
The following commands install Glimpse MVC5 and EF6 modules from the package manager console:
Instal following nuget
PM Install-Package Glimpse.MVC5
PM Insta
If anyone is facing the runtime error named as Parser Error .
Then simply go to your web.config file and make sure that in System.web tag have only following attributes.
system.web
compilation debug=true targetFramework=4.5 /
sessionState timeout=60 /
htt
A project with an output Type of Class Library Cannot be Started directly
In order to debug this project ,add an executable project to this solution which references the library project. set the executable project as the startup project.
How to use unbind and bind event in javascript
1. bind()
$(#BoxId).bind(click, (function () {
$(span).text(Single Clicked);
}));
2. unbind()
Unbind or detached the existing events is quite easy, just need to specified the attached event typ
How to disable browser cache in asp.net mvc
Problem:
asp.net mvc some time show old data in screens. to avoid this issue we need to disable cache.
Solution
1) Create a Filter
using System;
using System.Collections.Generic;
using System.Linq;
Problem:
I have kendo grid mvc, for some record date is null, if we are parse null date, it gives some incorrect result.
to avoid this issue, we shd parse date if date is not null.
Solution:
How to add not null check in kendogrid client template
colum
Web helper error occurs because there is missing nuget web.helper which cause this error.
We only need to install nuget mention below.
Go to tools bar in visual studio,---- then go to Nuget package manager ---- then Package manager console and install this.
Ins
On validation show related tab in asp.net mvc
Problem:
I have a asp.net mvc view. where i have multiple tabs. when user submit form. tab should be activated on which
validation message is occuring.
Solution
on Form Sumbit in jquery function of page submit o
This validation give error if field is empty and if number is incomplete.
label for=PhoneNumberCell Number:/label
input type=text data-role=maskedtextbox data-mask=9999-9999999 id=ContactNo name=ContactNo data-validmask-msg=Phone number is incomplete required=requir
1 Frist you have make the Controller and make the two table in database.
2 Name the table in database and you have make the folder in the name of database.
3 you have import the database in the Controller
using System;
using System.Collections
How to add dummy Data in a sql server table
1) Write Query that will insert data in a table
INSERT [dbo].[Ads] ( [ReferenceNumber], [AdName], [AdDescription], [City_Id], [Model_Id], [Year], [TransmittionType], [Color], [FuelType], [RegionalSpecs], [Mortgag
Auto logout when user not using website
Problem:
if user is not using website for some time, user shd be logout automatically.
Solution:
add below code in Java Script
function idleLogout() {
var t;
window.onload = resetTimer;
Login with facebook in asp.net mvc
1) Create a Facebook App using http://developers.facebook.com
then get following keys
2) add in web.config
add key=FacebookAppId value=383189645425584/
add key=FacebookAppSecret value=59e9bf6b1d846cc947ab9a70dfc2aa98/
How to increase performance in asp.net mvc?
1 ) Increasing the Performance of Entity Framework with Projection Queries
A standard Entity Framework query
// returns a list of Posts with all the fields
var posts = context.Posts.ToList();
Projection quer
How to add First and Last button option in asp.net mvc page list
Solution:
its very simple just add PagedListRenderOptions.ClassicPlusFirstAndLast
So code in mvc view will be as @Html.PagedListPager(Model.Ad, page = Url.Action(Index, new { page, pageSize =
Frist you can make the database Table in the Dropdown you have enter the project name with database.
you enter the database in Controller
you enter in action you make the list with object and make the new list and write table name with table id and table name.
How to activate tab on which validation error is occuring
on page submit call below code in javascript
var validator = $(form#BrowseAccountEdit).kendoValidator({
validate: function () {
var tabId = $(.k-invalid:first).attr(data-tabid);
var tabL
Your connection is not secure error while using ssl
some time we get red alert in while we are using ssl, or get alert get message insecure contents block
Solution:
when we used SSL schema is https then we shd have https for all css/js.
Check if a sites conn
Bundling and Minification in asp.net mvc
a) Bundling allow to load more than one file in one request
b) Minification remove unnecessary white space and comments and shortening variable names to one character.
in App_Start\BundleConfig.cs add following function
how to get first and last character from a string C#
Solution
public static string FirstLast(string word)
{
return word[0] + ... + word[word.Length - 1];
}
How to send email in asp.net mvc with attachment
Step1
Create a class and set properties those will be used to support email system
[Serializable]
public class EmailMessageObject
{
private string _fromemail;
private string _fromname;
How to speed up asp.net mvc
- Set Debug=false
-Cache, Compression, httpCompression
- Compress dynamic and static types
system.webServer
security
requestFiltering
requestLimits maxAllowedContentLength=2147483647 /
/requestFiltering
/sec
How you can install SSL on Godady
Login to Plesk control panel, Click on Website Domains, then choose a domian like abc.com
Step 1) then click on SSL Certificate
then submit a form to Get key.
Step 2) Then go to hosting and Click on Manage SSL or set up ssl. th
How to preserve session using cookie?
How to preserve session all time until user is logged out
Just get value from cookie and reset it all time from cookie if session is nul,
Create a BaseController and override OnActionExecuting, when any action is called.
How to Perform crud in asp.net mvc
1) open the visual studio and sql Server
2) frist you can make the database in Sql Server in the name of ContractManagement and make the table in the name of Contract
and add the Columns in the of (ContractID,Name,Email,Phone
Connection pool timeout is occurring due to the maximum pool size being reached - Solved
Connection pool timeout is occurring due to the maximum pool size being reached.
Here are some suggestions to address the issue:
Ensure that all connections are c
QUESTION :
System.Data.Entity.Validation.DbEntityValidationException
HResult=0x80131920
Message=Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
Source=EntityFramework
StackTrace:
at System.Data.Entity
If you have a controller with the same name (e.g., "HomeController") in different projects and you want to differentiate between them, a straightforward solution is to specify the project name when creating a route map. By doing so, when you run the application, it wi
Problem: when I access appliction in browser, I see following error message
HTTP Error 500.24 - Internal Server Error:An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
Solution:
Fix - Create application pool with the sa
Problem:
I deployed asp.net mvc website on new server and getting below error "
Could not load file or assembly 'Microsoft.ReportViewer.WebForms'"
Solution:
on new server install MICROSOFT REPORT VIEWER 2012 RUNTIME and MICROSOFT REPORT VIEWER 2015 RUNTIME
Most PopularInterviews Questions asp.net developer with Answers
1- Design patterns (Singleton, Abstract, Repository)
is template for how to solve a problem that can be used in many different situations.
Singleton Design Pattern: This pattern ensures that th
In .NET Core, you can retrieve values from the appsettings.json file using the Configuration object provided by the Microsoft.Extensions.Configuration package. Here's how you can do it:
Add a reference to the Microsoft.Extensions.Configuration package in your project.I
How to set defaultroute in asp.net mvc application from web.config
Solution:
Add Key web.config as below
add key=DeafaultPageAfterLogin value=/MyOrderedMeals /
in controller or route.config file set redirect url to
if (ConfigurationManager.AppS
Problem:
I tried to connect reports view in asp.net - Getting eror "an error occured during local report processing." when I click on "View Report"
Solution:
to fix this issue go to "Report Data" Choose data source , click on properties of Dataset and set sql server
Error Details:
When I run Project in visual studio getting below error.
if ypu haSeverity Code Description Project File Line
Error An error occurred while signing: Failed to sign bin\Debug\app.publish\projectname.exe.
SignTool Error: No certificates were
Problem:
When I try to run project in Visual Studio 2019, I am getting below error.
Error Details:
Server Error in / Application.
Could not load file or assembly Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3
The setup for this installation of visual studio is not complete. Please run the visual
sutdio installer again to correct the issue.
Solution:
Just right click on solution file and open it with any version of visual studio.
Step 1
private void ParseRss(NewsCategory categoryItem)
{
// get rss link
}
Step 2
upadate rss using task.wait all
public void PorcessNews()
{
var newsCategoryList = _storedb.NewsCategories.ToList();
Task.WaitAll((from product in news
Date of Brith of .net core
what is age of .net core?
VersionRelease dateReleased with.NET Core 1.02016-06-27Visual Studio 2015 Update 3.NET Core 1.12016-11-16Visual Studio 2017 Version 15.0.NET Core 2.02017-08-14Visual Studio 2017 Version 15.3.NET Core 2.12018-05-30Vi
Manual Testingis a type of software testing in which test
cases are executed manually by a tester without using any automated tools. The purpose of Manual Testing is to identify
the bugs, issues, and defects in the software application. Manual software testing is
the
1) Install nuget using SelectPdf;
Select.HtmlToPdf.17.3.0
2) Create html page
pass that html page to pdf page using following way
public ActionResult MyPDF(int id)
{
var ticketDetail = _uow.Tickets.GetById(id);
var
Chat with us!
Albie S
Sales Advisor
Good
Albie S
Hello. How may I help you?
Hi Developer
Developer
HI
i have shared hosting with godady.
Albie S
Welcome to live chat support
Developer
i have one question.
Albie S
11:43 pm
Sure
Please let me
Severity Code Description Project File Line Suppression State
Error The "Microsoft.CodeAnalysis.BuildTasks.Csc" task could not be loaded from the assembly E:\Work_Assign\Installment\TFS\Installment\packages\Microsoft.Net.Compilers.2.1.0\build\..\tools\Microsoft.Build
How to activate Zong Package
how to apply zong package
Solution
Prepaid MBB 100 GB BundleGet 100 GB for 30 days in Rs.3720
Auto Renewal does not Apply
To Activate/Deactivate: Dial *6767# from your Zong Master number or login the MBB device interface (http://192.1
How to update skin of mvcgrid
how to change theme of mvc grid.
Solution
Just repplace mvcgrid dll in nuget folder
e.g
E:\New Projects\WD\SC_F\WD\Weladela\packages\MVCGrid.Net.1.0.0.61\lib\net40
Quesiton:
I tryed to run the visual sutdio 2017 and getting below error.
The setup for this installation of visual studio is not complete. Please run the visual studio installer again to correct
the issue.
Solution
Question
Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine
I am getting above error, while try to process *.doc or *.csv file from C#
Answer:
following stesp
https://stackoverflow.com/questions/6649363/microsoft-ace
How to upload file on ftp
how to unzip file and upload on ftp
Solution
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.Web
Problem:
I am browsing diffrent pages,, i want to get url of previous page. on current page.
Solution:
System.Web.HttpContext.Current.Request.UrlReferrer.ToString();
How to use Github In visual studio
Get Latest form Git using visual studio
For code sharing we use TFS or Git as version control. to use Github get latest code. we need to Install
Github Extenstion
Steps Open Visual Studio Tools Extensions and Udates Onll
How to save login detail into cookies:
Step 1: Create a Class
public class ManageCookies
{
public void SetCookies(string EncodedCredentials)
{
HttpCookie cookie = HttpContext.Current.Request.Cookies[GlobalCookieName] ??
new HttpCookie(GlobalCoo
I this artical i will explain how to save value in cookies and how to get those values when needed.
why we need this
I was developed a Web application in mvc where session time out create problems ,so to handle this satuation i use cookies.
without time was
Here im going to explain how you can create enum and get theDescription of your enum
for instance
your enum class
public enum MyEnum
{
[Description(Invalid Email or Passwrod)]
INVALID_LOGIN = 2002
}
Now you want to get[Description(Invalid Em
How to bind drop down in asp.net mvc 5 ?
Problem:
I have a web form, i want to show dropdown in that page, i want to fill the dropdown values from database.
Solution.
1-Code that will return list of user types from database.
var itemss = Model.GetBuye
Implementing Active Directory Login in an ASP.NET MVC application involves several steps. Here is a basic guide to get started:
Step 1: Create an ASP.NET MVC Application Create a new ASP.NET MVC application using Visual Studio.
Step 2: Install Required Packages In
public class BusinessManager
{
//InnerException.Common.BusinessManager.
//InnerException.Common.BusinessManager.FMShare()
public static string FMShare()
{
return https://futureminutes.com/fm-share.png;
}
Calcula
Problem: how to create folder if missing in website
Solution:
add key in web.config
add key=UploadedFilePath value=C:\menuitemphoto\/add
in your asp.net code write below
string fileuploaddingpath = ConfigurationManager.AppSettings[UploadedFi
How to enablegzip compression in asp.net mvc
Soluiton:
just add this function in global.asax.cs file
void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
var app = sender as HttpApplication;
if (app != null)
Hosting Server Connect Timeout
Security
Hosting Server Connect Timeout
HTTP 504 Unable to Connect to the Origin Server
Please try again in a few minutes
Error details:
Error Code: HTTP 504
Error Code: Backend or gateway connection timeout.
Data visualization is an essential aspect of modern web applications, allowing users to understand complex information quickly. One popular type of chart for displaying data trends over time is the Area Chart. In this article, we will explore how to implement an Area Ch