Sanal.org
till 01th May 2006
Categories
.NET (40)
Art (1)
Blogs (1)
Computers (6)
Information (13)
Internet (11)
Movies (5)
Music (19)
MY SQL (5)
People (16)
Russian (20)
Security (15)
SEO (3)
SQL SERVER (8)
Technology (6)
Turkey (2)
Video (7)
More
TOP 50
Turkish News


Archive
April (2008)
March (2008)
February (2008)
January (2008)
December (2007)
Novamber (2007)
October (2007)
September (2007)
August (2007)
July (2007)
June (2007)
May (2007)
April (2007)
March (2007)
February (2007)
January (2007)
December (2006)
Novamber (2006)
October (2006)
September (2006)
August (2006)
July (2006)
June (2006)
May (2006)
April (2006)
March (2006)
February (2006)
January (2006)
December (2005)
October (2005)
April (2005)
December (1969)

29

ROR
Previous1234Next

Client does not support authentication protocol requested by server; consider upgrading MySQL client


This happens because the latest versions of MySql uses a new format for the password (it's a longer hash). In order for old clients to continue to use the newer server, you have to set the passwords on the server to their old format or upgrade your client. Because upgrading the client can sometimes be a pain, it's often easier to just update the passwords to the old format on the server.
Run mysql and login as root:

mysql -u root -p

Then, paste the following command, editing as necessary, to change the password of the user to the old format.
UPDATE mysql.user
SET password=OLD_PASSWORD('somepassword')
WHERE user='someuser'
AND host='somehost';

After you have set the passwords to the old format, flush the tables.
flush privileges;

Then exit the mysql client with "quit" and you are set.



Auto-refreshing ASP.NET web pages


This means: forcing a page postback or redirect from a client browser without explicit user input.

Why would you want to do that? The main reasons are:

    Auto-redirecting to a new URL after a brief time period Refreshing page information periodically Maintaining a valid session state indefinitely Forcing a specific process to run on the server when the client session has expired.

The following methods are the constructs we have used in our web development projects:

HTML header refresh tag

The most common and best known way - a tag of the following format is placed in the HTML section of the page:

<meta http-equiv="refresh" content="8;url=http://dotnet.org.za/">

    where '8' refers to the number of seconds that will elapse before the page is refreshed; 'url' is the new url redirect to. It can be excluded which means the current page will be reloaded.</LI>

This construct is useful if you have one or two pages which have to auto-refresh, and works for any HTML content type forms.  The downside is the refresh interval cannot be set dynamically, and if you are testing for session timeouts on your site, you'll have to embed this construct in every page of the site.

Response.AppendHeader method

ASP.NET provides the AppendHeader method to the Response object. Typically the page refresh can be set as follows in an ASP.NET webform (in C#):

this.Response.AppendHeader("Refresh",
    Convert.ToString(Session.Timeout * 60 + 5));

Here the page refresh is set to 5 seconds after the client session timeout setting specified in the web.config file.

This construct is useful as it can be placed in a base webform OnLoad() or Page_Load() response method. All derived webforms will then have the same page refresh setting when they are loaded. Obviously, if the timeout value is changed in the web.config file, no modification is required in this code and everything still works fine.

Page OnLoad method script

The same thing can be done by setting a script for the client-side HTML using the HtmlGenericControl.Attributes collection:

string onload = "window.setTimeout(
    'window.location.href=window.location.href'," +
    Convert.ToString( (Session.Timeout * 60 + 5) * 1000) + ");";
this.body.Attributes.Add("onload", onload);

Unfortunately, to get this to work you need to add the following attribute to the tag in the HTML:

runat="server"

and the following member in the webform code-behind class:

protected System.Web.UI.HtmlControls.HtmlGenericControl body;

Hmmm - so why do this, if it means that we have to fiddle with the HTML?

In our experience, certain ASP.NET controls in the webform actually kills the working of the previous two constructs - but this method always seems to work....regardless...in Internet Explorer...

In future posts, I will look more closely at managing ASP.NET session timeouts with re-logins for secured sites.




Adding Meta Tags to the Head in ASP.NET 2.0


'******* System.Web.UI.HtmlControls should be imported

 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim Keywords As String = "Veritaban?ndan gelen liste"
Dim Description As String = "Veritaban?ndan gelen aç?klama"
Dim Title As String = "Ahmet Kaymaz - Bu sayfaya özel ba?l?k"


‘********** Creating a meta object for Keywords tag

Dim Meta As HtmlMeta = New HtmlMeta()

‘******* Adding name and content to object

        Meta.Attributes.Add("name", "keywords")
        Meta.Attributes.Add("content", Keywords)
        Header.Controls.Add(Meta)

‘********** Creating a meta object for Description tag
        Meta = New HtmlMeta()

‘******* Adding name and content to object

        Meta.Attributes.Add("name", "description")
        Meta.Attributes.Add("content", Description)
        Header.Controls.Add(Meta)

‘*********** Update the page Title
        Page.Title = Title
End Sub



Previous1234Next

0.015625
Bilgi Portalı | Forum | Haberler | Havacılık | Daily News | Noticias