Wish you Happy New Year 2010 from Asp.Net Developer's Group


Thursday, December 31, 2009






How to integrate Nochex Payment Gateway in C# ?


Wednesday, December 16, 2009

Solution :

Step 1 : Create one project in visual studio, and add below code in the HTML code of default.aspx page.



<table class="productholder" border="0" cellpadding="10" cellspacing="0" width="600">
<tbody>
<tr>
<td valign="top">
<h1>
Micro Helicopter</h1>
<h2>
Super Cool remote control copter!</h2>
<p>
An absolute must for all gadget heads - this amazing remote control copter is the
business. Just like what Nochex does for your business – this beauty will take you
to another level. Be a chopper pilot!
</p>
</td>
<td valign="top">
<img src="http://www.ukgadgetsrus.com/images/productimage-copter.gif" alt="Helecopter"
height="138" width="137" /></td>
<td valign="top">
<span class="stock">In stock</span><br />
<span class="prices">RRP £59.99</span><br />
<span class="prices2">Our Price £39.99 </span>
<form action="https://www.nochex.com/nochex.dll/checkout" method="post">
<div align="center">
<input type="hidden" name="email" size="64" value="xyz@xyz.com">
<input type="hidden" name="amount" size="8" value="39.99">
<br>
<input type="hidden" name="logo" size="64">
<br>
<input type="hidden" name="returnurl" value="http://localhost:1856/Nochex%20Payment%20Gateway%20Example/default.aspx" />
<input name="image" type="image" src="http://support.nochex.com/web/images/cardsboth2.gif"
alt="I accept payment using NOCHEX" />
</div>
</form>
</td>
</tr>
</tbody>
</table>



Step 2 : In the code you need to change the email value to your account email id, please replace that.

Step 3 : Set value of amount, logo and returnurl according to your product details.

Step 4 : thats it, you have done with payment integration.

Step 5 : Just select visa option for example and carry on with this credit card : 4111111111111111 and set issue number to 12 and Security number to 123.

Step 6 : Continue with the payment, after doing payment successfull, nochex website will return you to your return url.

Step 7 : Such a simple way to integrate Nochex payment gateway.

Step 8 : if you are satisfied with my explaination above, please put comment for me or if you feel any difficulties please put question as comment, i will reply to your question.

Please find Demo below

Merchant Payment Demo
http://www.ukgadgetsrus.com/merchant-payment-page.html

Seller Payment Demo
http://www.ukgadgetsrus.com/seller-payment-page.html


Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

How to refresh a page at regular interval of time ?


Monday, December 14, 2009

Solution :

It seems to be very tough task to do this, but acutaly it is not.

you can do this by adding one line code in your HTML code.

you just have to put meta tags in <head> part of your html code.

Please find the code below showing, where you need to put the code to refresh a page at regular interval of time.

To change the time interval, you just have to change the CONTENT value, currently i have placed 3, change accouring to your need.


<head runat="server">
<title>Asp.Net Developer, Resource mall for developer</title>
<META HTTP-EQUIV="Refresh" CONTENT="3;URL=http://www.rajeshssingh.blogspot.com/">
</head>



Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

How to add www prefix to my domain name in address bar ?




Solution :

Mostly User dont type "www" before our domain name, either they are searching in google or directly into address bar of browser.

for example, user type "indianic.com" in address bar of browser.

then the url of our website looks like this "http://indianic.com", this really looks odd.

what if our URL automatically redirect to http://www.indianic.com, Yes now its look nice and seo friendly.

This is possible, by adding just below code in your page load event in c#.

For other languages developer, need not need to worry, this is simple "if condition", you can easlily covert it into your language.

Please find below sample code.


protected void Page_Load(object sender, EventArgs e)
{
if (Request.ServerVariables["SERVER_NAME"] != "localhost")
{

if (sCheckUrl.IndexOf("http://") == 0)
{
if (sCheckUrl.IndexOf("http://www.") != 0)
{
Response.Redirect(sCheckUrl.Replace("http://indianic", "http://www.indianic"));
}
}
else if (sCheckUrl.IndexOf("https://") == 0)
{
if (sCheckUrl.IndexOf("https://www.") != 0)
{
Response.Redirect(sCheckUrl.Replace("http://indianic", "http://www.indianic"));
}
}
}
}


Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

Google running AdWords ads in Newspapers


Saturday, December 5, 2009


Google running AdWords ads in newspapers

Please see this picture to see at which column of newspaper show google ads.

Google has shown its ads in the Dec 12 sports section of the Sun-Times.

I dont know, how google is going to make track of Pay Per Click (PPC) or Pay Per View (PPV).

I guess, Now the googles next step would be, how to show google search engine in Newspapers.

Imagine the day, you woke up in morning and you are getting late for the office and you just picked up the newspaper and typed your keyword in the search column of newspaper and you find your search without wasting time.

Imagine the day that would be, Hope the google get this feature soon in newspaper.

Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

Get variables from web.config and global.asax





There are two methods, you can assign variable at one place and call it from through out the website.

The first is, Declare the variable in web.config and call it in any aspx.cs page and the second is, Declare the variable in global.asax and call it in any aspx.cs page.

The first one is very usefull because you can edit it directly form the FTP editor.

Please find explanation and code of both method below,


First Method:
web.config
<appSettings>
<add key="siteurl" value="www.indianic.com"/>
<add key="TempDir" value="./uploads"/>
</appSettings>

Default.aspx.cs
ConfigurationSettings.AppSettings["siteurl"].ToString();
ConfigurationSettings.AppSettings["TempDir"].ToString();


Second Method:
global.asax
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
Application["siteurl"] = "www.indianic.com";
Application["TempDir"] = "./uploads";
}

Default.aspx.cs
string smtphost = Application["siteurl"].ToString();
string userid = Application["TempDir"].ToString();


Please use any of the above method which is needed in your application.

Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

How to align two div in same row ?


Tuesday, December 1, 2009

This is one of the Issue which make developer to pull His/Her Hair,

To align two div in same row, is really very simple, after you know, how it is done.

See the Demo below,

Code :
<div>Rajesh</div><div>Singh</div>


Output :
Rajesh
Singh


Solution to this Problem,

Code :
<div style="float:left;">Rajesh</div><div>Singh</div>


Output :
RajeshSingh


Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com