How to remove specific session in

You can set session element to null.


Session["sessionname"] = null;

Posted in | 0 comments

How to parse html in C#?


You Can use Html Agility Pack
Details is availbale at

This is an agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...). It is a .NET code library that allows you to parse "out of the web" HTML files. The parser is very tolerant with "real world" malformed HTML. The object model is very similar to what proposes System.Xml, but for HTML documents (or streams).


using Fizzler that takes a jQuery/Sizzler approach to selecting HTML elements. It's based on HTML Agility Pack.Details available at below location.

Posted in | 0 comments

Sending mail from my gmail account through .Net

Below is sample to send mail from your gmail account.

We will use System.Net.Mail to send mail from gmail account.

using System.Net;
using System.Net.Mail;
var fromAddress = new MailAddress("", "Your Name");
var toAddress = new MailAddress("", "Receipt Name");
const string fromPassword = "YourPassword";
const string subject = "Subject";
const string body = "Body";
var smtp = new SmtpClient
    Host = "",
    Port = 587,
    EnableSsl = true,
    DeliveryMethod = SmtpDeliveryMethod.Network,
    UseDefaultCredentials = false,
    Credentials = new NetworkCredential(fromAddress.Address, fromPassword)
using (var message = new MailMessage(fromAddress, toAddress)
    Subject = subject,
    Body = body

Posted in | 0 comments

Difference between ScriptManager and ScriptManagerProxy in

You can only have one script manager per page but you can have multiple ScriptManagerProxy.

Used ScriptManagerProxy if you have the script manager in your master for instance which will go across all pages but you want a script manager reference in an underlying page or user control. 

In that instance you would add the proxy. If you added another script manager the page would error.

Posted in | 0 comments