Category: ASP.NET
ASP.NET tutorials and snippets
-
Owin Google Logout in Asp.net Identity
In our asp.net application we can use Owin to login and/or register with Gmail. After creating a successful login to your asp.net application using gmail. You can still see that the gmail is logged in eventhough you are redirected to your application. The following snippet…
-
Remove index.php from wordpress URL in IIS
Recently, I installed a WordPress website in the IIS web server and did all the standard settings in the wordpress admin, like general, reading, permalinks. And when running the site all the URL were with index.php eg. site.com/index.php/about-us/. so to remove the index.php from the…
-
Prevent Cross Site Scripting – Disable Form Submission if HTML tags detected using Custom Validator Javascript in ASP.NET Webform
Still there are applications developed using asp.net webform. In your application when a user enters html tags for cross site scripting or load malicious script to inject into your site in your forms and submit you will get the following error A potentially dangerous Request.Form…
-
Using Date Format in Eval
Hi this is a very simple tip, when you want to Date Format and Use Date Format in Eval, here is the snippet. You all know that Eval or Bind can only be used inside DataControls like Gridview, Repeater, Datalist Snippet for Using Date Format…
-
Redirect HTTP to HTTPS along with WWW or Without WWW using web.config
After Google has recommended to use SSL in all your websites that collect personal data. Most of the major websites are implementing SSL – secure socket layer for their websites. You can buy a cheap SSL from namecheap.com or Get a free SSL from Let’s…
-
Add Canonical tags on .ASPX pages Automatically using C#
Just a small snippet to add link rel=”canonical” tag to your aspx pages using c# We can use the canonical tag to tell the search engines to discard duplicate pages. if you see a red underline in HtmlLink object, because if it does not has…
-
Solved – DataTable does not support schema inference from Xml
Getting the error: DataTable does not support schema inference from Xml When you are trying to read XML file to DataTable. This error throws when the datatable does not have any columns defined matching the XML FILE. To fix this, Create the DataTable with the…
-
Getting and Setting New Values in FormView.ItemInserting Event
In this example snippet, i am going to show how to get values from a FormView Control and also assign new values to a field. This is a raw snippet, so if you are searching for an idea to insert or update a value in…
-
Select/Deselect all Items in asp.net Checkbox list using Jquery
The following snipped shows how to select/deselect all items – check/uncheck all items in asp.net CheckBoxList Control using jquery. I have omitted the page directive from example.
-
Get Registered user email in asp.net identity
We all started to use the new asp.net identity for our user management in asp.net applications. In your asp.net identity system if you are using plain user name as login username then in situations you may need to get the registered user’s email if you…