Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

c#

Converting image into data:image/png;base64 for web page disaplay

September 1, 2022 by Magenaut

If one visits jQuery-File-Upload Demo page and will try to upload an image, and then will look at the JSON response, he would notice that a preview of an uploaded image is returned in a format:

Categories ASP.NET, Q&A Tags asp.net, c#, encoding, image, json Leave a comment

How to prevent XSS (Cross Site Scripting) whilst allowing HTML input

August 31, 2022 by Magenaut

I have a website that allows to enter HTML through a TinyMCE rich editor control. It’s purpose is to allow users to format text using HTML.

Categories ASP.NET, Q&A Tags asp.net, c#, html, javascript, xss Leave a comment

A Real Timespan Object With .Years & .Months

August 31, 2022 by Magenaut

Consider the following 2 scenarios: Scenario 1). Today is May 1st 2012, and Scenario 2). Today is September 1st 2012.

Categories ASP.NET, Q&A Tags asp.net, c#, datetime, timespan, vb.net Leave a comment

Prevent page scrolling after postback and maintain position

August 31, 2022 by Magenaut

I am working with adding up user’s scores based on their checks in a CheckBoxList. Every time a user checks a box, a value, X, is added to the overall score. When a user unchecks a box, a value, X, is subtracted from the overall score. No problems here.

Categories ASP.NET, Q&A Tags asp.net, c#, javascript, vb.net Leave a comment

Overwrite Existing Jpeg File/Replace Existing Jpeg File with edited jpeg file

August 31, 2022 by Magenaut

I have build a program which allows me to insert comment and the title of an Image through System.Image.Drawing so right now, I have trouble trying to overwrite the existing Jpeg file with the one that has comment and title added into it, but I am encountering error while deleting the file, so I’m not sure what to do as I have tried disposing the file but I cant saved it in that case, due to the fact that I disposed it too early, but I cant saved it because the existing file name is not deleted so I’m kinda stuck in the middle right now.

Categories ASP.NET, Q&A Tags asp.net, c#, jpeg, metadata Leave a comment

Accessing class member from static method

August 31, 2022 by Magenaut

I know there are a lot of threads talking about this but so far I haven’t found one that helps my situation directly. I have members of the class that I need to access from both static and non-static methods. But if the members are non-static, I can’t seem to get to them from the static methods.

Categories ASP.NET, Q&A Tags asp.net, c#, non-static, static Leave a comment

How to avoid HttpContext.Server.MapPath for Unit Testing Purposes

August 31, 2022 by Magenaut

I am working in an ASP.net MVC 5 application. I would like to Unit Test my controller action which looks like this

Categories ASP.NET, Q&A Tags asp.net, asp.net-mvc-5, c#, rhino-mocks, unit-testing Leave a comment

Html to pdf some characters are missing (itextsharp)

August 31, 2022 by Magenaut

I want to export gridview to pdf by using the itextsharp library. The problem is that some turkish characters such as İ,ı,Ş,ş etc… are missing in the pdf document. The code used to export the pdf is:

Categories ASP.NET, Q&A Tags .net, asp.net, c#, itextsharp, pdf-generation Leave a comment

The Role Manager feature has not been enabled

August 31, 2022 by Magenaut

Got the following ProviderException :

Categories ASP.NET, Q&A Tags asp.net, c#, roleprovider Leave a comment

Is it possible to have both Azure AD and Individual Account authentication in one ASP.NET MVC application?

August 31, 2022 by Magenaut

I am kind of successful by doing this in the Startup.Auth.cs file

Categories ASP.NET, Q&A Tags asp.net, asp.net-mvc, authentication, azure, c# Leave a comment
Older posts
Newer posts
← Previous Page1 … Page153 Page154 Page155 … Page451 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress