Posts

Create Login With Role Using Thee Tire Architecture In Asp.Net C#

Image
1) Create table CREATE TABLE  `dbname`.`login` (   `id` int(11) NOT NULL auto_increment,   `userid` varchar(50) default NULL,   `password` varchar(50) default NULL,   `Role` varchar(200) default NULL,   KEY `id` (`id`) ) 2) Insert Values into table ID USER-ID PASSWORD ROLE 1 Admin Admin@123456 Admin 2 Pratibha pratibha@123 Agent 3 Rohan rohan@123 Agent 4 User User@123 Customer

EBS Payment Gateway Integration In ASP.net C#

Full code of EBS payment Gateway Integration in .net Create Page name as pay.aspx and paste code

Redirect URL In asp.net c#

1) In location path add your old url 2) Then in httpRedirect add  your new url 3) In global.asax add new url to redirect on old page. There is page activities/scuba-diving.aspx  now i want new url that is activities/best-rated-scuba-diving-in-goa.aspx  there is no page by this name , i will redirect my old url to new url but page  will be same  activities/scuba-diving.aspx. <configuration>   <location path="activities/scuba-diving.aspx">     <system.webServer>       <httpRedirect enabled="true" destination="https://www.domain.com/activities/best-rated-scuba-diving-in-goa.aspx" httpResponseStatus="Permanent" />     </system.webServer>   </location> </configuration> Now add following code in global.asax.   static void RegisterRoutes(RouteCollection routes)     { routes.MapPageRoute("DynamicPagescuba", "activities/best-rated-scuba-divin...

Error : Object cannot be cast from DBNull to other types.

when there is null value in column we get following error Object cannot be cast from DBNull to other types. adding  following dbnull.value?false will resolve error in you f=gridview Checked =' <% # Eval("Approved")==DBNull.Value?false: Convert.ToBoolean(Eval("Approved"))  %> '

Convert aspx Page To PDF In asp.net

Response.ContentType = "application/pdf" ;         Response.AddHeader( "content-disposition" , "attachment;filename=TestReport.pdf" );         Response.Cache.SetCacheability( HttpCacheability .NoCache);         StringWriter sw = new StringWriter ();         HtmlTextWriter hw = new HtmlTextWriter (sw);         this .Page.RenderControl(hw);         StringReader sr = new StringReader (sw.ToString());         Document pdfDoc = new Document ( PageSize .A4, 2f, 2f, 10f, 0f);         HTMLWorker htmlparser = new HTMLWorker (pdfDoc);         PdfWriter .GetInstance(pdfDoc, Response.OutputStream);         pdfDoc.Open(); ...

Send HTML Form Data To Google Spreadsheet

Why to go with google form when you want to use your own form. Build your own html form and send all the records to google spreadsheets, here is the code and step by step procedures to submit your data in google spreadsheets. Just Follow simple steps.

Delete Query In MYSQL Using Between Clause

To delete a particular row from table  here is MySQL query to delete with INT , String valuse and using between clasue in MYSQL. Syntax Use sql syntax delete command to delete data from MySQL table delete from login where id = 1 Delete data from table using between clause Syntax delete from login where id between 3 and 5; Delete data from table using string value in where clause, Syntax use single quote for any string values you can see the example delete from login where userid= 'admin' ;