42,167 questions
-1
votes
1
answer
311
views
Reading date from oracle database and converting it to datetime
DateTime dt = DateTime.Parse(dataReader["Date"].ToString());
I am using this command to read the data from the database but the output dt will be like this
/Date(1655788824000)/. Any ...
0
votes
0
answers
116
views
baguetteBox - lightbox not working inside knockout js foreach binding
I try to preview image using baguetteBox.run when clicking an image.
The problems are, whenever I click image src inside foreach binding. It redirect to new File src page (File: C/(file url) instead ...
0
votes
1
answer
818
views
400-Bad request- request header to long
I'm trying to generate pdf,but after like the 5th page header and footer display http error 400-bad request-request header to long. is there anyway to solve this problem? a response header can look ...
0
votes
1
answer
273
views
ASP.Net Core MVC : How to use css after press button in the section of HTML.BeginForm
My code are below
@using (Html.BeginForm("PostUsingParameters", "loopW"))
{
<input type="text" name="num" /><br />
<input type="...
0
votes
1
answer
584
views
Binding data from session to drop down list asp.net mvc
In my web application, I have added a dropdownlist for the nav bar.
There I want to load some data from the database.
So in the Home Controller, I have used a view bag option.
ViewBag.MyBranch_Id = ...
1
vote
2
answers
347
views
How to close connection of a WCF client instantiated via interface?
I have a WCF client that has been instantiated via its interface on my MVC 4 project controller like this:
private readonly ILMS_Service lms_client;
public ProductsController(ILMS_Service client)
{
...
0
votes
1
answer
447
views
Passing Session variable from one controller to another
I have created a session for User Login as:
[HttpPost]
public ActionResult Index(UserLogin lc)
{
string mainconn = ConfigurationManager.ConnectionStrings["DBConnection"].ConnectionString;...
0
votes
1
answer
238
views
2 trailing dots in URL crashing 403 Forbidden
When any page on my site built in MVC has 2 trailing dots the page crashes and the user receives a 403 forbidden error.
Example:
This url will load correctly: https://www.example.com/folder/
When ...
0
votes
1
answer
783
views
How to refresh ASPNET claims in cookie after updating a role using userManager.AddToRoleAsync?
I am using QuickStart UI for Identity Server to login users from multiple mvc clients. The users then have the ability to switch their role based on a dropdown using userManager.AddToRoleAsync(...
0
votes
1
answer
136
views
Unable to create an object of type 'AppDbcontext'. I run into this error
I am following a Udemy course. I am getting the error in the title and I also took a screenshot of the error. Unable to create an object of type 'AppDbcontext'. For the different patterns supported at ...
1
vote
0
answers
628
views
Serilog - Preserve current log file name and custom archive names
Currently using:
Serilog 2.11.0
Serilog.Sinks.File 5.0.0
Serilog.Sinks.RollingFile 3.3.0
With the following logger configuration:
_logger = new LoggerConfiguration()
....
0
votes
2
answers
855
views
Asp.net MVC DB First Approach - Migrations
For my past Asp.NET MVC projects I have used the Code First approach to create my web applications.
Here I got a new one, there is an old system with an already created SQL Server Database.
I need to ...
1
vote
1
answer
1k
views
How to apply colors to outlook calendar events using Microsoft graph api?
Currently, events are created on the outlook calendar from my portal now I want to apply colors when I create events using graph API
https://graph.microsoft.com/v1.0/me/calendar/events
I also follow ...
2
votes
2
answers
7k
views
How to set default values to string if it is null or empty
Is there Better way to check if a string is empty or null using Null Coalescing operator .When I use empty value to a string instead of null the null Coalescing operator failed to get me the desired ...
1
vote
1
answer
784
views
Read Google Mail Box through Search Filter like Date
I think my question is a bit off. I read Google Mailbox via MailKit Thanks to this Answer. I want to read a mailbox with a search filter from-date to end-date.
E.g I want to read emails for June 2020 ...
0
votes
2
answers
1k
views
Update Image without losing the old path in Asp.net MVC
i need help.
I want to update image in Edit page, but just when it is necessary.
the problem is whenever i do an edit i have to upload the image again.
i want to keep the old image if i do not want to ...
0
votes
1
answer
1k
views
302 Redirect from https to http
I am using IIS and have a webforms website with a C# backend, that I am trying to make more secure. I started to add security headers and upon doing so noticed that a certain page kept receiving a &...
2
votes
1
answer
802
views
What option do I have instead of GetAwaiter.GetResult() in ASP.NET MVC 4 on .NET v4.6.1?
I am working on an old ASP.NET MVC 4 website running on .NET v4.6.1 that I cannot change and I am calling a web api2 using HttpClient.
As you know, the call requires is an async call, however ...
0
votes
2
answers
507
views
Asp.net mvc 5 SendGrid not confirming Email upon click
I was following the "Create a secure ASP.NET MVC 5 web app with log in, email confirmation and password reset (C#)" from Microsoft
I had a hard time setting up the SendGrid Api since i am ...
-1
votes
1
answer
147
views
I'm having trouble trying to edit my product. Before it was working but it wasn't saving. Now it's no longer saving, let alone editing
I'm having trouble trying to edit my product. Before it was working but it wasn't saving. Now it's no longer saving, let alone editing.
I've tried everything, but I can't succeed. I have 2 models of ...
0
votes
1
answer
1k
views
ASP.NET MVC partial not binding when a passing property though
I've been away from ASP.NET MVC for a while so forgotten some of the basics.
I have scoured SO for an answer, but none really seem to apply/work so this may seem like a duplicate question but it's ...
0
votes
1
answer
1k
views
Configure OpenIdConnect Owin middleware to fire only once
I have an asp.net 4.8 web application, it is hybrid webforms/mvc. I am moving it from forms authentication to OpenIdconnect authentication using Owin.
I have a Startup.cs class with the usual "...
1
vote
1
answer
714
views
ASP.Net MVC Dropdownlist List selected item values not displaying in the same View
I am trying to display a dropdown list in my View and I am able to generate the list items in the dropdown list and once an item is selected, I am trying to gather the details of the selected item and ...
0
votes
1
answer
208
views
Issue in the structure of the ASP.NET MVC project retreiving error 404
I'm new to ASP.NET MVC and using C# to create a project. The file structure looks like the image below. Now I am confused about the structure of the project. For each model, I have a controller and a ...
1
vote
2
answers
141
views
I need an regular expression for validate comma separated emails
I am following Entity framework code first approach.
I have following property in one of my models.
I want to validate comma separated emails by this regular expression.
But it is not working fine.
Ex:...