Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > .NET Framework > Forum > [asp.net c#] มาตามคำขอ ajax control toolkit ว่าด้วยเรื่อง autocomplete extender



 

[asp.net c#] มาตามคำขอ ajax control toolkit ว่าด้วยเรื่อง autocomplete extender

 



Topic : 044317



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์




logo

มาตามทำขอ ไม่รู้ใครขอ ถึงไม่มีใครขอเราก็จะเขียน

เริ่มกันเลย เพราะสงสัยว่าจะยาว

1. ขั้นแรกเราต้องไป download asp.net ajax control toolkit มาใช้ก่อนจาก http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Calendar/Calendar.aspx

เอา version binary file มาก็พอไฟล์เนี่ย AjaxControlToolkit.Binary.NET35.zip



Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2010-06-21 20:24:58 By : tungman View : 12862 Reply : 30
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

AjaxToolkit สุดยอดของเค้าดีจริงครับ


ASP.NET & Ajax






Date : 2010-06-21 20:26:05 By : webmaster
 


 

No. 2



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


2. ต่อไปก็ extract zip ออกมา เราจะเห็นไฟล์ต่างๆ เยอะแยะและก็มี AjaxControlToolkit.dll ด้วย

กลับไปที่ visual studio คลิกขวาที่ folder bin แล้วเลือก add existing item... (ถ้าไม่มีให้คลิกขวา

ที่ชื่อ project ใน solution explorer เลือก add asp.net folder-->bin) แล้ว browse ไปที่ folder

ที่แตก AjaxControlToolkit.Binary.NET35.zip แล้ว add AjaxControlToolkit.dll เข้ามาในโปรเจ็ค

2

3. เสร็จแล้วมา add toolbox สำหรับ asp.net ajax control toolkit โดย

คลิกขวาที่ toolbox เลือก add tab ตั้งชื่อว่า AJAX Control Toolkit



จากนั้นคลิกขวาใน tab AJAX Control Toolkit เลือก choose items...

4

เลือก tab .net framework components กดปุ่ม browse แล้ว browse

ไปที่ AjaxControlToolkit.dll ใน folder bin ของโปรเจ็คของเรา (ที่ add ไว้ตะกี้)

5

เราก็จะเจอ icon สวยๆ ของ asp.net ajax control toolkit

2
Date : 2010-06-21 20:28:24 By : tungman
 

 

No. 3



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


4. จากนั้นก็ไป register ajax control toolkit ให้โปรเจ็คของเรารู้จักโดย เปิด Web.config ขึ้นมา

ให้ไปหา tag ชื่อ page แล้วเขียนส่วนนี้เพิ่มลงไป

โค้ดสำหรับ register control
<add tagPrefix="ajax" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>

ให้เพิ่มใน tag pages-->controls
<pages>
   <controls>
      ....
      ....
   </controls>
</pages>


เท่านี้ asp.net ajax control toolkit ก็พร้อมใช้งาน
Date : 2010-06-21 20:30:35 By : tungman
 


 

No. 4



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


อ้าว wm เข้ามาทักทาย สวัสดีครับคุณวิน

มาถึงตรงนี้ ก็ถึงการใช้งาน autocomplete extender แล้ว

แต่การที่จะใช้งานมันได้นั้นเราต้องมีฐานข้อมูล ซึ่งในการ review นี้

เราจะใช้ฐานข้อมูล pokemon ซึ่งมาจาก http://pokemondb.net/

โดยเราจะทำ http request ไปดูดข้อมูล pokedex มาสร้างเป็น table ในฐานข้อมูลของเรา

4

ไม่ต้องถามว่าทำไมต้องเป็น pokemon ก็แค่สนองตัณหาของตัวเองเท่านั้น เข้าใจไหม
Date : 2010-06-21 20:40:09 By : tungman
 


 

No. 5



โพสกระทู้ ( 1,603 )
บทความ ( 1 )



สถานะออฟไลน์


ไม่เข้าใจค่ะ
Date : 2010-06-21 20:43:49 By : blurEyes
 


 

No. 6



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


เริ่มแรกเลย ตามธรรมเนียมขอเริ่มด้วย class sqldatabasemanager

สร้าง class ใหม่ใน folder app_code ตั้งชื่อว่า SqlDatabaseManager.cs

แล้วก็อปโค้ดด้านล่างไปใช้ (นับวัน class นี้ยิ่งยาวขึ้นเรื่อยๆ -_-")

SqlDatabaseManager.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using System.Data;
using System.Data.SqlClient;
using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using System.Web.Configuration;

#region ========== Class SqlDatabaseManager ==========
/// <summary>
/// Summary description for SqlDatabase
/// </summary>
public abstract class SqlDatabaseManager
{
    #region ========== Field ==========
    private SqlConnection sqlConnection;
    private SqlCommand sqlCommand;
    private SqlTransaction sqlTransaction;
    private List<string> errorCommand;

    private string sqlConnectionString = string.Empty;
    private string sqlConnectionKeyName = string.Empty;
    private string sqlCommandString = string.Empty;
    private string commandMessage = "You must execute command.";
    private bool commandSuccess = false;
    private bool transaction = false;
    private int rowsAffected = 0;
    #endregion

    #region ========= Constructor ==========
    /// <summary>
    /// Use sql connection string from web.config configulation.
    /// </summary>
    public SqlDatabaseManager()
    {
        if (WebConfigurationManager.ConnectionStrings["SqlConnectionString"] != null)
        {
            //สำหรับ web.config ที่มีการ add connection string ชื่อ SqlConnectionString เอาไว้
            //
            //ตัวอย่างใน web.config
            //<connectionStrings>
            //    <add name="SqlConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=SqlDatabase;Integrated Security=True;" providerName="System.Data.SqlClient"/>
            //</connectionStrings>

            sqlConnectionKeyName = "SqlConnectionString";
            sqlConnectionString = WebConfigurationManager.ConnectionStrings["SqlConnectionString"].ToString();
            sqlConnection = new SqlConnection(sqlConnectionString);
        }
        else
        {
            sqlConnection = new SqlConnection();        
        }
    }

    /// <summary>
    /// Use sql connection string from web.config configulation by key name.
    /// </summary>
    public SqlDatabaseManager(string SqlConnectionKeyName)
    {
        sqlConnectionKeyName = SqlConnectionKeyName;
        sqlConnectionString = WebConfigurationManager.ConnectionStrings[sqlConnectionKeyName].ToString();
        sqlConnection = new SqlConnection(sqlConnectionString);
    }

    /// <summary>
    /// Use sql connection string by user define.
    /// </summary>
    public SqlDatabaseManager(string SqlConnectionKeyName, string SqlConnectionString)
    {
        sqlConnectionKeyName = SqlConnectionKeyName;
        sqlConnectionString = SqlConnectionString;
        sqlConnection = new SqlConnection(sqlConnectionString);
    }    
    #endregion

    #region ========== Property ==========
    /// <summary>
    /// Gets or sets Sql connection key name from web.config.
    /// </summary>
    protected virtual string ConnectionKeyName
    {
        get { return sqlConnectionKeyName; }
        set
        {
            sqlConnectionKeyName = value;
            sqlConnectionString = WebConfigurationManager.ConnectionStrings[sqlConnectionKeyName].ToString();
            sqlConnection = new SqlConnection(sqlConnectionString);   
        }
    }

    /// <summary>
    /// Gets or sets Sql connection.
    /// </summary>
    protected virtual string ConnectionString
    {
        get { return sqlConnectionString; }
        set 
        {
            sqlConnectionString = value;
            sqlConnection = new SqlConnection(sqlConnectionString);
        }
    }

    /// <summary>
    /// Gets or sets Sql command.
    /// </summary>
    protected virtual string CommandString
    {
        get { return sqlCommandString; }
        set
        {
            sqlCommandString = ConvertDateCommand(value);
            sqlCommand = new SqlCommand(sqlCommandString, sqlConnection);

            commandMessage = "You must execute command.";
            commandSuccess = false;
            rowsAffected = 0;

            if (transaction)
                sqlCommand.Transaction = sqlTransaction;
        }
    }

    /// <summary>
    /// Check for Sql command.
    /// </summary>
    protected virtual bool IsSuccess
    {
        get { return commandSuccess; }
    }

    /// <summary>
    /// Gets message from Sql command.
    /// </summary>
    protected virtual string Message
    {
        get { return commandMessage; }
    }

    /// <summary>
    /// Gets Number of rows affected.
    /// </summary>
    protected virtual int RowsAffected
    {
        get { return rowsAffected; }
    }
    #endregion

    #region ========== Method ==========
    /// <summary>
    /// Add the parameter value to the sql command.
    /// </summary>
    /// <param name="ParameterName">The name of Parameter.</param>
    /// <param name="ParameterValue">The value to be added.</param>
    protected virtual void AddParameter(string ParameterName, object ParameterValue)
    {
        sqlCommand.Parameters.AddWithValue(ParameterName, ParameterValue);
    }

    /// <summary>
    /// Add the parameter value to the sql command.
    /// </summary>
    ///<param name="ParameterName">The name of the parameter.</param>
    ///<param name="SqlDataType">One of the SqlDbType  values.</param>
    ///<param name="Size">The column length.</param>
    ///<param name="ColumnName">The name of the source column.</param>
    protected virtual void AddParameter(string ParameterName, SqlDbType SqlDataType, int Size, string ColumnName)
    {
        sqlCommand.Parameters.Add(ParameterName, SqlDataType, Size, ColumnName);
    }

    /// <summary>
    /// Start Sql Transaction.
    /// </summary>
    protected virtual void TransactionStart()
    {
        transaction = true;
        errorCommand = new List<string>();

        if (sqlConnection.State != ConnectionState.Open)
            sqlConnection.Open();

        sqlTransaction = sqlConnection.BeginTransaction(IsolationLevel.ReadCommitted);    
    }

    /// <summary>
    /// Insert the DataTable to database.
    /// </summary>
    /// <param name="DataSource">The name of the DataTable. </param>
    /// <returns>Result of command.</returns>
    protected virtual bool Insert(DataTable DataSource)
    {
        bool result = false;

        try
        {
            SqlDataAdapter sqlAdapter = new SqlDataAdapter();
            sqlAdapter.InsertCommand = sqlCommand;
            rowsAffected = sqlAdapter.Update(DataSource);

            commandMessage = "Command is successfully.";
            commandSuccess = true;
            result = true;
        }
        catch (Exception ex)
        {
            commandMessage = ErrorMessage(ex.Message);
            commandSuccess = false;
        }

        return result;
    }

    /// <summary>
    /// Update the database by DataTeble.
    /// </summary>
    /// <param name="DataSource">The name of the DataTable. </param>
    /// <returns>Result of command.</returns>
    protected virtual bool Update(DataTable DataSource)
    {
        bool result = false;

        try
        {
            SqlDataAdapter sqlAdapter = new SqlDataAdapter();
            sqlAdapter.UpdateCommand = sqlCommand;
            rowsAffected = sqlAdapter.Update(DataSource);

            commandMessage = "Command is successfully.";
            commandSuccess = true;
            result = true;
        }
        catch (Exception ex)
        {
            commandMessage = ErrorMessage(ex.Message);
            commandSuccess = false;
        }

        return result;
    }

    /// <summary>
    /// Delete the database by DataTeble.
    /// </summary>
    /// <param name="DataSource">The name of the DataTable. </param>
    /// <returns>Result of command.</returns>
    protected virtual bool Delete(DataTable DataSource)
    {
        bool result = false;

        try
        {
            SqlDataAdapter sqlAdapter = new SqlDataAdapter();
            sqlAdapter.DeleteCommand = sqlCommand;
            rowsAffected = sqlAdapter.Update(DataSource);

            commandMessage = "Command is successfully.";
            commandSuccess = true;
            result = true;
        }
        catch (Exception ex)
        {
            commandMessage = ErrorMessage(ex.Message);
            commandSuccess = false;
        }

        return result;
    }
    
    /// <summary>
    /// Execute Sql Transaction.
    /// </summary>
    /// <returns>Result of transaction.</returns>
    protected virtual bool ExecuteTransaction()
    {
        transaction = false;

        if (errorCommand.Count == 0)
        {
            sqlTransaction.Commit();

            commandMessage = "All command is successfully. <font color=\"darkgreen\">Transaction Commited.</font>";
            commandSuccess = true;
        }
        else
        {
            sqlTransaction.Rollback();

            string ErrorText = "Some command has error. <font color=\"red\">Transaction Rollback.</font><br />Error in: <br />";

            foreach (string aErrorSqlCommand in errorCommand)
            {
                ErrorText += aErrorSqlCommand + "<br />";
            }

            commandMessage = ErrorText;
            commandSuccess = false;
        }

        errorCommand.Clear();

        if (sqlConnection.State == ConnectionState.Open)
            sqlConnection.Close();

        return commandSuccess;
    }

    /// <summary>
    /// Execute Query Sql command.
    /// </summary>
    /// <returns>Query data in DataTable.</returns>
    protected virtual DataTable ExecuteQuery()
    {
        DataTable dataTable = new DataTable();

        try
        {
            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
            sqlDataAdapter.Fill(dataTable);
            sqlDataAdapter.Dispose();

            commandMessage = "Command is successfully.";
            commandSuccess = true;
        }
        catch (Exception ex)
        {
            commandMessage = ErrorMessage(ex.Message);
            commandSuccess = false;
        }

        rowsAffected = dataTable.Rows.Count;

        return dataTable;
    }

    /// <summary>
    /// Execute Scalar Sql command.
    /// </summary>
    /// <returns>Object of value.</returns>
    protected virtual object ExecuteScalar()
    {
        object Result = 0;

        try
        {
            if (transaction)
            {
                Result = sqlCommand.ExecuteScalar();
            }
            else
            {
                if (sqlConnection.State != ConnectionState.Open)
                    sqlConnection.Open();

                Result = sqlCommand.ExecuteScalar();
                sqlConnection.Close();
            }

            commandMessage = "Command is successfully.";
            commandSuccess = true;
        }
        catch (Exception ex)
        {
            commandMessage = ErrorMessage(ex.Message);
            commandSuccess = false;
            if (transaction) AddErrorCommand(sqlCommandString, ex.Message);
        }

        return Result;
    }

    /// <summary>
    /// Execute Non Query Sql command.
    /// </summary>
    /// <returns>Result of execute command.</returns>
    protected virtual bool ExecuteNonQuery()
    {
        rowsAffected = 0;

        try
        {
            if (transaction)
            {
                rowsAffected = sqlCommand.ExecuteNonQuery();
            }
            else
            {
                if (sqlConnection.State != ConnectionState.Open)
                    sqlConnection.Open();

                rowsAffected = sqlCommand.ExecuteNonQuery();
                sqlConnection.Close();
            }

            commandMessage = "Command is successfully.";
            commandSuccess = true;
        }
        catch (Exception ex)
        {
            commandMessage = ErrorMessage(ex.Message);
            commandSuccess = false;
            if (transaction) AddErrorCommand(sqlCommandString, ex.Message);
        }

        return commandSuccess;
    }

    /// <summary>
    /// Build error message.
    /// </summary>
    /// <param name="Message">Message string.</param>
    /// <returns>Error message string.</returns>
    protected virtual string ErrorMessage(string MessageString)
    {
        return "<font color=\"red\">Command error.</font> " + MessageString;
    }

    /// <summary>
    /// Add error sql command to string collections.
    /// </summary>
    /// <param name="commandString">The sql command.</param>
    /// <param name="errorMessage">The error message.</param>
    protected virtual void AddErrorCommand(string commandString, string errorMessage)
    {
        errorCommand.Add(commandString + " <font color=\"red\">[Error message: " + errorMessage + "]</font>");
    }

    /// <summary>
    /// Convert native command to sql command.
    /// </summary>
    /// <param name="commandString">The native sql command.</param>
    /// <returns>The standard sql command.</returns>
    protected virtual string ConvertDateCommand(string commandString)
    {
        string SmallDateTimePattern = "[sS][mM][aA][lL][lL][dD][aA][tT][eE][tT][iI][mM][eE]\\([@][0-9a-zA-Z\\s]{1,}\\)";
        Regex SmallDateTimeRgx = new Regex(SmallDateTimePattern);

        foreach (Match SmallDateTimeMatchCase in SmallDateTimeRgx.Matches(commandString))
        {
            string MatchCasePattern = "^[sS][mM][aA][lL][lL][dD][aA][tT][eE][tT][iI][mM][eE]";
            Regex MatchCaseRgx = new Regex(MatchCasePattern);
            Match RemoveMatch = MatchCaseRgx.Match(SmallDateTimeMatchCase.Value);
            string TempMatchCase = SmallDateTimeMatchCase.Value.Replace(RemoveMatch.Value, "");

            commandString = commandString.Replace(SmallDateTimeMatchCase.Value, TempMatchCase.Replace("(", "Convert(SmallDateTime, ").Replace(")", ", 103)"));
        }

        string DateTimePattern = "[dD][aA][tT][eE][tT][iI][mM][eE]\\([@][0-9a-zA-Z\\s]{1,}\\)";
        Regex DateTimeRgx = new Regex(DateTimePattern);

        foreach (Match DateTimeMatchCase in DateTimeRgx.Matches(commandString))
        {
            string MatchCasePattern = "^[dD][aA][tT][eE][tT][iI][mM][eE]";
            Regex MatchCaseRgx = new Regex(MatchCasePattern);
            Match RemoveMatch = MatchCaseRgx.Match(DateTimeMatchCase.Value);
            string TempMatchCase = DateTimeMatchCase.Value.Replace(RemoveMatch.Value, "");

            commandString = commandString.Replace(DateTimeMatchCase.Value, TempMatchCase.Replace("(", "Convert(DateTime, ").Replace(")", ", 103)"));
        }

        return commandString;
    }
    #endregion
}
#endregion

#region ========== Class SqlConvert ==========
/// <summary>
/// Summary description for SqlConvert
/// </summary>
public sealed class SqlConvert
{
    /// <summary>
    /// Convert to byte[].
    /// </summary>
    /// <param name="BinaryStream">File upload binary stream.</param>
    /// <param name="StreamLength">Lenght of File upload binary stream.</param>
    /// <returns>Byte[] of binary stream.</returns>
    public static byte[] ToVarBinary(Stream BinaryStream, int StreamLength)
    {
        BinaryReader BinaryRead = new BinaryReader(BinaryStream);
        byte[] binaryData = BinaryRead.ReadBytes(StreamLength);

        return binaryData;
    }

    /// <summary>
    /// Convert to DataTime DataType with d/M/yyyy format.
    /// </summary>
    /// <param name="DateString">DateTime sring.</param>
    /// <returns>Datetime Type.</returns>
    public static DateTime ToDateTime(string DateString)
    {
        //ควรกำหนด culture ใน web.config เป็น th
        //
        //ตัวอย่างใน web.config
        //<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="th-TH" uiCulture="th-TH"/>

        return DateTime.ParseExact(DateString, "d/M/yyyy", CultureInfo.InvariantCulture);
    }

    /// <summary>
    /// Convert to DataTime DataType with user define format.
    /// </summary>
    /// <param name="DateString">DateTime sring.</param>
    /// <param name="DateFormat">DateTime Format</param>
    /// <returns>Datetime Type.</returns>
    public static DateTime ToDateTime(string DateString, string DateFormat)
    {
        //ควรกำหนด culture ใน web.config เป็น th
        //
        //ตัวอย่างใน web.config
        //<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="th-TH" uiCulture="th-TH"/>

        return DateTime.ParseExact(DateString, DateFormat, CultureInfo.InvariantCulture);
    }
}
#endregion

Date : 2010-06-21 20:45:45 By : tungman
 


 

No. 7



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


Quote:
ไม่เข้าใจค่ะ


ก็มันน่ารักดีอะ

----------------

ลืม add connection string

ให้เปิด Web.config ขึ้นมาแล้วไปที่ tag <connectionStrings>...</connectionStrings>

เพิ่ม connection string ของใครของมันเข้าไป ของผมใช้อันนี้

Web.config
<add name="SQLConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=SqlDatabase;Integrated Security=True" providerName="System.Data.SqlClient" />

Date : 2010-06-21 20:46:30 By : tungman
 


 

No. 8



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


กว่าจะได้ data มาเล่นซะเหนื่อย

คลิกขวาที่ app_code สร้าง class ชื่อ PokedexData.cs แล้วก็อปโค้ดด้านล่างไปแปะ

class นี้ใช้สำหรับสร้าง table พร้อมข้อมูล pokemon ลงในฐานข้อมูลของเราโดยไปดูดมาจาก

http://pokemondb.net/

PokedexData.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using System.Data;
using System.Data.SqlClient;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;

/// <summary>
/// Summary description for PokedexData
/// </summary>
public class PokedexData : SqlDatabaseManager
{
	public PokedexData()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public void CreatePokedexTable()
    {
        DataTable PokedexTable = new DataTable();

        if (!TableExist("PokedexTable"))
        {
            string RequestedPokedex = RequestHtmlData("http://pokemondb.net/pokedex/all");
            PokedexTable = GetPokedexData(RequestedPokedex);

            CreateTable("PokedexTable");
            FillPokedexData(PokedexTable);
        }

        PokedexTable.Dispose();
    }

    public void DeletePokedexTable()
    {
        if (TableExist("PokedexTable"))
            DropTable("PokedexTable");
    }

    private string RequestHtmlData(string Url)
    {
        WebClient objWebClient = new WebClient();

        byte[] byteRequestedHtml = objWebClient.DownloadData(Url);
        UTF8Encoding objUtf8 = new UTF8Encoding();

        return objUtf8.GetString(byteRequestedHtml);
    }

    private bool TableExist(string TableName)
    {
        base.CommandString = string.Format("If Object_ID('{0}', 'U') Is Not Null Select 'true' Else Select 'false'", TableName);

        return Convert.ToBoolean(base.ExecuteScalar());
    }

    private bool DropTable(string TableName)
    {
        base.CommandString = string.Format("Drop Table [{0}]", TableName);

        return base.ExecuteNonQuery();
    }

    private bool CreateTable(string TableName)
    {
        base.CommandString = string.Format("Create Table [{0}] ([PokemonID] int Identity(1,1) Primary Key Clustered, [PokemonCode] nvarchar(50), [PokemonName] nvarchar(50), [PokemonHp] int, [PokemonAttack] int, [PokemonDefense] int, [PokemonSpAttack] int, [PokemonSpDef] int, [PokemonSpeed] int, [PokemonIcon] varbinary(MAX), [PokemonArtwork] varbinary(MAX))", TableName);

        return base.ExecuteNonQuery();
    }

    private bool FillPokedexData(DataTable PokemonData)
    {
        base.CommandString = "Insert Into [PokedexTable] ([PokemonCode], [PokemonName], [PokemonHp], [PokemonAttack], [PokemonDefense], [PokemonSpAttack], [PokemonSpDef], [PokemonSpeed], [PokemonIcon], [PokemonArtwork]) Values (@PokemonCode, @PokemonName, @PokemonHp, @PokemonAttack, @PokemonDefense, @PokemonSpAttack, @PokemonSpDef, @PokemonSpeed, @PokemonIcon, @PokemonArtwork)";
        base.AddParameter("@PokemonCode", SqlDbType.NVarChar, 50, "PokemonCode");
        base.AddParameter("@PokemonName", SqlDbType.NVarChar, 50, "PokemonName");
        base.AddParameter("@PokemonHp", SqlDbType.Int, 4, "PokemonHp");
        base.AddParameter("@PokemonAttack", SqlDbType.Int, 4, "PokemonAttack");
        base.AddParameter("@PokemonDefense", SqlDbType.Int, 4, "PokemonDefense");
        base.AddParameter("@PokemonSpAttack", SqlDbType.Int, 4, "PokemonSpAttack");
        base.AddParameter("@PokemonSpDef", SqlDbType.Int, 4, "PokemonSpDef");
        base.AddParameter("@PokemonSpeed", SqlDbType.Int, 4, "PokemonSpeed");
        base.AddParameter("@PokemonIcon", SqlDbType.VarBinary, -1, "PokemonIcon"); // -1 is Max Length
        base.AddParameter("@PokemonArtwork", SqlDbType.VarBinary, -1, "PokemonArtwork"); // -1 is Max Length

        return base.Insert(PokemonData);
    }

    private DataTable GetPokedexData(string RequestHtml)
    {
        string[] TextArray = RequestHtml.Split(new char[] { '\n' });

        DataTable PokedexTable = new DataTable();
        PokedexTable.Columns.Add(new DataColumn("PokemonCode", typeof(string)));
        PokedexTable.Columns.Add(new DataColumn("PokemonName", typeof(string)));
        PokedexTable.Columns.Add(new DataColumn("PokemonHp", typeof(int)));
        PokedexTable.Columns.Add(new DataColumn("PokemonAttack", typeof(int)));
        PokedexTable.Columns.Add(new DataColumn("PokemonDefense", typeof(int)));
        PokedexTable.Columns.Add(new DataColumn("PokemonSpAttack", typeof(int)));
        PokedexTable.Columns.Add(new DataColumn("PokemonSpDef", typeof(int)));
        PokedexTable.Columns.Add(new DataColumn("PokemonSpeed", typeof(int)));
        PokedexTable.Columns.Add(new DataColumn("PokemonIcon", typeof(byte[])));
        PokedexTable.Columns.Add(new DataColumn("PokemonArtwork", typeof(byte[])));

        bool start = false;
        string code = string.Empty;
        string name = string.Empty;
        int hp = 0;
        int attack = 0;
        int defense = 0;
        int spAtt = 0;
        int spDef = 0;
        int speed = 0;

        foreach (string aString in TextArray)
        {
            string PokedexStartPattern = "<tdclass=\"numeric\"id=\"[\\D]{1,}\"><spanclass=\"pkIcon[\\D]{1,}\"></span>[0-9]{3}</td>";
            Regex PokedexStartRgx = new Regex(PokedexStartPattern);
            string PokedexStartMatch = (PokedexStartRgx.Match(aString.Trim().Replace(" ", string.Empty)) != null) ? PokedexStartRgx.Match(aString.Trim().Replace(" ", string.Empty)).Value : string.Empty;

            string PokedexEndPattern = "<tdclass=\"numerictotal\">[0-9]{1,}</td>";
            Regex PokedexEndRgx = new Regex(PokedexEndPattern);
            string PokedexEndMatch = (PokedexEndRgx.Match(aString.Trim().Replace(" ", string.Empty)) != null) ? PokedexEndRgx.Match(aString.Trim().Replace(" ", string.Empty)).Value : string.Empty;

            if (PokedexStartMatch != string.Empty)
            {
                start = true;

                string[] pokemonText = PokedexStartMatch.Replace("<tdclass=\"numeric\"id=\"", string.Empty).Replace("\"><spanclass=\"pkIcon", ",").Replace("\"></span>", ",").Replace("</td>", string.Empty).Split(new char[] { ',' });
                code = pokemonText[2];
                name = pokemonText[0];
            }

            if (start && PokedexStartMatch.Trim() == string.Empty && PokedexEndMatch.Trim() == string.Empty)
            {
                string PokedexPattern = "<tdclass=\"numeric\">[0-9]{1,}</td>";
                Regex PokedexRgx = new Regex(PokedexPattern);

                if (PokedexRgx.Match(aString.Trim().Replace(" ", string.Empty)).Value != string.Empty)
                {
                    string aValue = PokedexRgx.Match(aString.Trim().Replace(" ", string.Empty)).Value.Replace("<tdclass=\"numeric\">", string.Empty).Replace("</td>", string.Empty);

                    if (hp == 0)
                        hp = int.Parse(aValue);
                    else if (attack == 0)
                        attack = int.Parse(aValue);
                    else if (defense == 0)
                        defense = int.Parse(aValue);
                    else if (spAtt == 0)
                        spAtt = int.Parse(aValue);
                    else if (spDef == 0)
                        spDef = int.Parse(aValue);
                    else if (speed == 0)
                        speed = int.Parse(aValue);
                }
            }

            if (start && PokedexEndMatch != string.Empty)
            {
                if (code != string.Empty)
                {
                    WebClient objWebClient = new WebClient();

                    string icon = string.Empty;
                    string artwork = string.Empty;

                    switch (name)
                    {
                        case "unown-a":
                            name = "unown";
                            icon = "unown-a";
                            artwork = "unown";
                            break;
                        case "burmy-plant":
                            name = "burmy";
                            icon = "burmy-plant";
                            artwork = "burmy";
                            break;
                        case "shellos-east":
                            name = "shellos";
                            icon = "shellos-east";
                            artwork = "shellos";
                            break;
                        case "gastrodon-east":
                            name = "gastrodon";
                            icon = "gastrodon-east";
                            artwork = "gastrodon";
                            break;
                        case "rotom-normal":
                            name = "rotom";
                            icon = "rotom";
                            artwork = "rotom";
                            break;
                        case "giratina-altered":
                            name = "giratina";
                            icon = "giratina";
                            artwork = "giratina";
                            break;
                        case "shaymin-land":
                            name = "shaymin";
                            icon = "shaymin";
                            artwork = "shaymin";
                            break;
                        default:
                            icon = name;
                            artwork = name;
                            break;
                    }

                    DataRow Dr = PokedexTable.NewRow();
                    Dr["PokemonCode"] = code;
                    Dr["PokemonName"] = name;
                    Dr["PokemonHp"] = hp;
                    Dr["PokemonAttack"] = attack;
                    Dr["PokemonDefense"] = defense;
                    Dr["PokemonSpAttack"] = spAtt;
                    Dr["PokemonSpDef"] = spDef;
                    Dr["PokemonSpeed"] = speed;
                    Dr["PokemonIcon"] = objWebClient.DownloadData(string.Format("http://pokemondb.net/images/sprites/diamond-pearl/icon/{0}.png", icon));
                    Dr["PokemonArtwork"] = objWebClient.DownloadData(string.Format("http://pokemondb.net/images/artwork/{0}.png", artwork));
                    PokedexTable.Rows.Add(Dr);
                }

                start = false;

                code = string.Empty;
                name = string.Empty;
                hp = 0;
                attack = 0;
                defense = 0;
                spAtt = 0;
                spDef = 0;
                speed = 0;
            }
        }

        DataView PokedexTableView = PokedexTable.DefaultView;
        PokedexTableView.Sort = "PokemonCode ASC";

        return PokedexTableView.ToTable();
    }
}


วันนี้พอแค่นี้แล้วกัน ไว้ต่อวันพรุ่งนี้
Date : 2010-06-21 23:36:58 By : tungman
 


 

No. 9



โพสกระทู้ ( 1,603 )
บทความ ( 1 )



สถานะออฟไลน์


เหนื่อยละหรอคะ ^^ สู้ๆค่ะ
Date : 2010-06-22 10:56:12 By : blurEyes
 


 

No. 10



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


แล้วก็มาสร้าง class ที่ใช้สำหรับ query ข้อมูล pokemon

โดยคลิกขวาที่ folder app_code เลือก add new item เลือกเป็นแบบ class ตั้งชื่อว่า PokedexTable.cs

จากนั้นก็อปโค้ดด้านล่างไปแปะ

PokedexTable.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using System.Data;

/// <summary>
/// Summary description for PokedexTable
/// </summary>
public class PokedexTable : SqlDatabaseManager
{
	public PokedexTable()
	{
		//
		// TODO: Add constructor logic here
		//
        PokedexData pokemon = new PokedexData();
        pokemon.CreatePokedexTable();
	}

    public DataTable GetAllPokedex()
    {
        base.CommandString = "Select [PokemonCode], [PokemonName], [PokemonHp], [PokemonAttack], [PokemonDefense], [PokemonSpAttack], [PokemonSpDef], [PokemonSpeed] From [PokedexTable]";
        
        return base.ExecuteQuery();
    }

    public byte[] GetPokemonIcon(string PokemonCode)
    {
        base.CommandString = "Select [PokemonIcon] From [PokedexTable] Where [PokemonCode]=@Code";
        base.AddParameter("@Code", PokemonCode);

        return (byte[])base.ExecuteQuery().Rows[0]["PokemonIcon"];
    }

    public byte[] GetPokemonArtwork(string PokemonCode)
    {
        base.CommandString = "Select [PokemonArtwork] From [PokedexTable] Where [PokemonCode]=@Code";
        base.AddParameter("@Code", PokemonCode);

        return (byte[])base.ExecuteQuery().Rows[0]["PokemonArtwork"];
    }

    public DataTable SearchPokemon(string Keyword)
    {
        base.CommandString = "Select [PokemonCode], [PokemonName], [PokemonHp], [PokemonAttack], [PokemonDefense], [PokemonSpAttack], [PokemonSpDef], [PokemonSpeed] From [PokedexTable] Where [PokemonName] Like @keyword";
        base.AddParameter("@keyword", string.Format("%{0}%", Keyword));

        return base.ExecuteQuery();
    }

    public bool IsPokemon(string PokemonName)
    {
        base.CommandString = "Select Count(*) As [Pokemon] From [PokedexTable] Where [PokemonName]=@keyword";
        base.AddParameter("@keyword", PokemonName);

        return ((int)base.ExecuteScalar() > 0) ? true : false;
    }

    public string GetPokemonCode(string PokemonName)
    {
        base.CommandString = "Select [PokemonCode] From [PokedexTable] Where [PokemonName]=@keyword";
        base.AddParameter("@keyword", PokemonName);

        DataTable Dt = base.ExecuteQuery();

        return (Dt.Rows.Count > 0) ? Dt.Rows[0]["PokemonCode"].ToString() : "0";
    }

    public DataTable GetPokemonData(string PokemonCode)
    {
        base.CommandString = "Select [PokemonCode], [PokemonName], [PokemonHp], [PokemonAttack], [PokemonDefense], [PokemonSpAttack], [PokemonSpDef], [PokemonSpeed] From [PokedexTable] Where [PokemonCode]=@Code";
        base.AddParameter("@Code", PokemonCode);

        return base.ExecuteQuery();
    }
}

Date : 2010-06-23 16:09:10 By : tungman
 


 

No. 11



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


ทีนี้ต้อง data และ image ของเหล่า pokemon ก็มาอยู่ใน database ของเราแล้ว

แต่การเรียก image ออกมาจำเป็นต้องมี file มารองรับดังนั้นเราจึงต้องสร้าง page ขึ้นมาเพื่อ

ใช้เป็นร่างทรงของ binary stream ของรูปที่เก็บใน database

โดยคลิกขวาที่ชื่อโปรเจ็คเลือก add new item เลือกเป็น web form ตั้งชื่อว่า PokemonImage.aspx

จากนั้นก็อปโค้ดด้านล่างไปแปะ

PokemonImage.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PokemonImage.aspx.cs" Inherits="PokemonImage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
</body>
</html>

PokemonImage.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class PokemonImage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["type"] != null && Request.QueryString["code"] != null)
        { 
            Page.Controls.Clear();

            PokedexTable pokemon = new PokedexTable();

            Response.ContentType = "image/png";

            switch (Request.QueryString["type"].ToString().ToLower())
            {
                case "icon":
                    Response.BinaryWrite(pokemon.GetPokemonIcon(Request.QueryString["code"].ToString()));
                    break;
                case "artwork":
                    Response.BinaryWrite(pokemon.GetPokemonArtwork(Request.QueryString["code"].ToString()));
                    break;
            }
        }
    }
}

Date : 2010-06-23 16:13:38 By : tungman
 


 

No. 12



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


จากนั้นมาลองทดสอบคือว่าสามารถดูดข้อมูล pokemon สำเร็จหรือไม่

โดยเราจะใช้ gridview แสดงข้อมูลและรูป ให้สร้าง web form ขึ้นมา

ตั้งชื่อว่า GetPokemon.aspx แล้วก็อปโค้ดด้านล่างไปใช้

GetPokemon.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GetPokemon.aspx.cs" Inherits="GetPokemon" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server">
        </asp:GridView>
    </div>
    </form>
</body>
</html>

GetPokemon.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class GetPokemon : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BoundField Icon = new BoundField();
            Icon.HeaderText = "Icon";

            BoundField Code = new BoundField();
            Code.HeaderText = "Code";
            Code.DataField = "PokemonCode";

            BoundField Name = new BoundField();
            Name.HeaderText = "Pokemon";
            Name.DataField = "PokemonName";

            BoundField Pic = new BoundField();
            Pic.HeaderText = "Picture";

            GridView1.Columns.Add(Icon);
            GridView1.Columns.Add(Code);
            GridView1.Columns.Add(Name);
            GridView1.Columns.Add(Pic);
        }

        PokedexTable pokemon = new PokedexTable();

        GridView1.AutoGenerateColumns = false;
        GridView1.RowDataBound += new GridViewRowEventHandler(GridView1_RowDataBound);
        GridView1.DataSource = pokemon.GetAllPokedex();
        GridView1.DataBind();
    }

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Image Icon = new Image();
            Icon.ImageUrl = string.Format("~/PokemonImage.aspx?type=icon&code={0}", e.Row.Cells[1].Text);
            e.Row.Cells[0].Controls.Add(Icon);

            Image Pic = new Image();
            Pic.ImageUrl = string.Format("~/PokemonImage.aspx?type=artwork&code={0}", e.Row.Cells[1].Text);
            e.Row.Cells[3].Controls.Add(Pic);
        }
    }
}


จากนั้นก็รัน ซึ่งจะกินเวลานานมาก แต่จะเป็นแบบนี้เฉพาะครั้งแรกที่รัน

เพราะต้องดาวน์โหลดข้อมูลและรูปจาก internet มาสร้าง table ใน database เครื่องผมที่ใช้รันใช้เวลา

โหลดเพจนี้ประมาณ 10 นาที เพราะฉะนั้นไม่ต้องตกใจ

1

เมื่อรันเสร็จถ้าไม่ error จะมี pokemon มาทักทาย

2

และใน ms sql server ก็จะมี table ใหม่ชื่อ PokedexTable เพิ่มขึ้นมา

3

และแล้วก็เสร็จสิ้นกระบวนการเตรียมข้อมูลในฐานข้อมูลซะที จะได้เริ่มเข้าเรื่องจริงๆ แล้วนะบัดนี้
Date : 2010-06-23 16:24:05 By : tungman
 


 

No. 13



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


feature ของโปรเจ็ค

1. มี textbox หนึ่งอันไว้พิมพ์ชื่อ pokemon ที่จะค้นหา เมื่อพิมพ์ลงไปมากกว่า 1 ตัวอักษร
จะปรากฎชื่อ pokemon ที่ใกล้เคียงกับที่เราพิมพ์มาให้เลือก ได้มากสุด 12 รายชื่อ (เพราะตั้งไว้)

2. ถ้าเลือกจากชื่อใน list หรือพิมพ์ชื่อที่ตรงกับ pokemon จะ redirection ไปหน้าแสดง detail
ของ Pokemon นั้น

3. ถ้าพิมพ์เพียงบางส่วนของชื่อหรือชื่อไม่ตรงกับ pokemon จะแสดงรายชื่อ pokemon ที่ใกล้เคียง
กับคำที่ใช้ค้นหาทั้งหมด โดยจะแสดงใน gridview

-------------------------------------------------------
1. มาเตรียม resource กันก่อน ให้คลิกขวาที่ชื่อโปรเจ็คสร้าง folder ตั้งชื่อว่า Images

เสร็จแล้ว download รูปพวกนี้ไป add exist item ลง folder Images (เปลี่ยนชื่อรูปตามที่กำหนดด้วย)

bar-bg.gif
bar-bg.gif



bar-left.gif
bar-left.gif



bar-right.gif
bar-right.gif



pokemonbg.gif
pokemonbg.gif
Date : 2010-06-24 11:37:59 By : tungman
 


 

No. 14



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


2. สร้าง master page ตั้งชื่อว่า Pokemon.master แล้วเอาโค้ดด้านล่างไปใส่

สังเกตวิธีการใช้ ToolkitScriptManager กับ AutoCompleteExtender ด้วย

Pokemon.master
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Pokemon.master.cs" Inherits="Pokemon" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Pokemon</title>
    <link href="PokemonAutoComplete.css" rel="stylesheet" type="text/css" />
    <link href="Pokemon.css" rel="stylesheet" type="text/css" />
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body onload="javascript:document.getElementById('<%=SearchTextBox.ClientID %>').focus();">
    <form id="form1" runat="server">
    <div>
        <ajax:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
            <Services>
                <asp:ServiceReference Path="~/PokemonAutoComplete.asmx" />
            </Services>
        </ajax:ToolkitScriptManager>

        <div style="padding: 25px 20px 25px 20px; border: 1px; border-bottom-style: solid; background-color: #36295e">
            <asp:TextBox runat="server" ID="SearchTextBox" Width="350" autocomplete="off" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" ControlToValidate="SearchTextBox"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="*" ControlToValidate="SearchTextBox" ValidationExpression="^[\D\S\.]{2,}"></asp:RegularExpressionValidator>
            <ajax:AutoCompleteExtender
                runat="server" 
                ID="autoComplete1" 
                TargetControlID="SearchTextBox"
                ServicePath="~/PokemonAutoComplete.asmx" 
                ServiceMethod="GetCompletionList"
                MinimumPrefixLength="2" 
                CompletionInterval="100"
                EnableCaching="true"
                CompletionListCssClass="autocomplete_completionListElement" 
                CompletionListItemCssClass="autocomplete_listItem" 
                CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                CompletionSetCount="12">
            </ajax:AutoCompleteExtender>
            <asp:Button ID="SearchButton" runat="server" Text="Pokemon" />        
        </div>
        <div style="padding: 10px 10px 10px 10px;">
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        
            </asp:ContentPlaceHolder>    
        </div>
    </div>
    </form>
</body>
</html>

Pokemon.master.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Pokemon : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        SearchButton.Click += new EventHandler(SearchButton_Click);
    }

    protected void SearchButton_Click(object sender, EventArgs e)
    {
        PokedexTable pokemon = new PokedexTable();

        if (pokemon.IsPokemon(SearchTextBox.Text.Trim()))
        {
            Response.Redirect(string.Format("~/pokemondata.aspx?code={0}", pokemon.GetPokemonCode(SearchTextBox.Text.Trim())));
        }
        else
        {
            Response.Redirect(string.Format("~/pokemon.aspx?keyword={0}", SearchTextBox.Text));
        }
    }
}

Date : 2010-06-24 11:40:52 By : tungman
 


 

No. 15



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


3. สร้าง style sheet ตั้งชื่อว่า PokemonAutoComplete.css แล้วเอาโค้ดด้านล่างไปใส่

PokemonAutoComplete.css
/*AutoComplete flyout */

.autocomplete_completionListElement 
{  
	margin : 0px!important;
	background-color : inherit;
	color : windowtext;
	border : buttonshadow;
	border-width : 1px;
	border-style : solid;
	cursor : default;
	overflow : auto;
    text-align : left; 
    list-style-type : none;
    padding-left: 0px;
}

/* AutoComplete highlighted item */

.autocomplete_highlightedListItem
{
	background-color: #87CEEB;
	color: black;
	padding: 1px;
}

/* AutoComplete item */

.autocomplete_listItem 
{
	background-color : window;
	color : windowtext;
	padding : 1px;
}
        
.ajax__tab_header 
{
    font-size: 12px;
    font-family: Tahoma, Sans-Serif;
}
        
/* Pager */
        
.pager:hover
{
    border: solid 2px #87CEEB;
    /* background-color: #FFFACD; */
}
        
.pager
{
    border: solid 2px #f0f0f0;            
}

4. สร้าง style sheet ตั้งชื่อว่า Pokemon.css แล้วเอาโค้ดด้านล่างไปใส่

Pokemon.css
body{
    background: #babdb6 url("/images/pokemonbg.gif");
    margin: 0px;
    padding: 0;
}

body,th,td,input,select,textarea{
    font-family:"verdana","dejavu sans",sans-serif;
    font-size:13px;line-height:1.33;
    text-align:left;
}

h1,h2,h3,h4{
    font-family:"georgia",serif;font-weight:normal;
}

h1{
    margin:0 0 0 0;
    color:#ce5c00;
    font-size:260%;
}

h1 em{
    color:#f57900;
}

h2{
    margin:0 0 0 0;
    font-size:200%;
    color:#2e3436;
}

table.base-stats th{
    color:#888a85;
    font-size:8pt;
    font-weight:normal;
    text-align:right;
    text-transform:uppercase;
    white-space:nowrap;
}

td.numeric{
    text-align:right;
}

td.total{
    font-weight:bold!important;
    font-size:108%!important;
    color:#555753!important;
}

td.graph{
    width:250px;
}

div.barchart{
    height:18px;
    background:#81b6e7 url("/images/bar-bg.gif") repeat-x;
}

div.barchart img.left{
    width:4px;
    height:18px;
    float:left;
}

div.barchart img.right{
    width:4px;
    height:18px;
    float:right;
}

Date : 2010-06-24 11:44:26 By : tungman
 


 

No. 16



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


5. สร้าง web form ตั้งชื่อว่า Pokemon.aspx แล้วติ๊กที่ Select master page

แล้วเลือก Pokemon.master เป็น master page จากนั้นใช้โค้ดด้านล่างไปแปะ

Pokemon.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/Pokemon.master" AutoEventWireup="true" CodeFile="Pokemon.aspx.cs" Inherits="Pokemon" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div style="background: #ffffff; padding: 10px; border: 1px solid black;">
        <asp:Label ID="Label1" runat="server" Text="Pokedex"></asp:Label>
        <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" 
            GridLines="None">
            <AlternatingRowStyle BackColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        </asp:GridView>
    </div>
</asp:Content>

Pokemon.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Pokemon : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["keyword"] != null)
        {
            Label1.Visible = false;

            if (!IsPostBack)
            {
                ((TextBox)Page.Master.FindControl("SearchTextBox")).Text = Request.QueryString["keyword"].ToString();

                BoundField Icon = new BoundField();
                Icon.HeaderStyle.Width = Unit.Parse("20px");

                BoundField Code = new BoundField();
                Code.HeaderText = "Code";
                Code.HeaderStyle.Width = Unit.Parse("50px");
                Code.DataField = "PokemonCode";

                BoundField Name = new BoundField();
                Name.HeaderText = "Pokemon";
                Name.HeaderStyle.Width = Unit.Parse("120px");
                Name.DataField = "PokemonName";

                BoundField Hp = new BoundField();
                Hp.HeaderText = "Hp";
                Hp.HeaderStyle.Width = Unit.Parse("60px");
                Hp.DataField = "PokemonHp";

                BoundField Attack = new BoundField();
                Attack.HeaderText = "Attack";
                Attack.HeaderStyle.Width = Unit.Parse("60px");
                Attack.DataField = "PokemonAttack";                   
                
                BoundField Defense = new BoundField();
                Defense.HeaderText = "Defense";
                Defense.HeaderStyle.Width = Unit.Parse("60px");
                Defense.DataField = "PokemonDefense";            

                BoundField SpAttack = new BoundField();
                SpAttack.HeaderText = "Sp.Att";
                SpAttack.HeaderStyle.Width = Unit.Parse("60px");
                SpAttack.DataField = "PokemonSpAttack";    
 
                BoundField SpDef = new BoundField();
                SpDef.HeaderText = "Sp.Def";
                SpDef.HeaderStyle.Width = Unit.Parse("60px");
                SpDef.DataField = "PokemonSpDef";

                BoundField Speed = new BoundField();
                Speed.HeaderText = "Speed";
                Speed.HeaderStyle.Width = Unit.Parse("60px");
                Speed.DataField = "PokemonSpeed";

                BoundField Total = new BoundField();
                Total.HeaderText = "Total";
                Total.HeaderStyle.Width = Unit.Parse("60px");

                GridView1.Columns.Add(Icon);
                GridView1.Columns.Add(Code);
                GridView1.Columns.Add(Name);
                GridView1.Columns.Add(Hp);
                GridView1.Columns.Add(Attack);
                GridView1.Columns.Add(Defense);
                GridView1.Columns.Add(SpAttack);
                GridView1.Columns.Add(SpDef);
                GridView1.Columns.Add(Speed);
                GridView1.Columns.Add(Total);
            }

            PokedexTable pokemon = new PokedexTable();
            GridView1.AutoGenerateColumns = false;
            GridView1.DataSource = pokemon.SearchPokemon(Request.QueryString["keyword"].ToString());
            GridView1.RowDataBound += new GridViewRowEventHandler(GridView1_RowDataBound);
            GridView1.DataBind();
        }
    }

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Image Icon = new Image();
            Icon.ImageUrl = string.Format("~/PokemonImage.aspx?type=icon&code={0}", e.Row.Cells[1].Text);
            e.Row.Cells[0].Controls.Add(Icon);

            HyperLink NameLink = new HyperLink();
            NameLink.Text = string.Format("<strong>{0}</strong>", e.Row.Cells[2].Text);
            NameLink.NavigateUrl = string.Format("~/pokemondata.aspx?code={0}", e.Row.Cells[1].Text);
            e.Row.Cells[2].Controls.Add(NameLink);

            e.Row.Cells[9].Text = string.Format("<strong>{0}</strong>", (int.Parse(e.Row.Cells[3].Text) + int.Parse(e.Row.Cells[4].Text) + int.Parse(e.Row.Cells[5].Text) + int.Parse(e.Row.Cells[6].Text) + int.Parse(e.Row.Cells[7].Text) + int.Parse(e.Row.Cells[8].Text)).ToString());
        }
    }
}

Date : 2010-06-24 11:48:19 By : tungman
 


 

No. 17



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


6. คลิกขวาที่ชื่อโปรเจ็ค เลือก add new item... เลือกเป็น web service ตั้งชื่อว่า PokemonAutoComplete.asmx

vs จะ gen ไฟล์ออกมา 2 ไฟล์ คือ PokemonAutoComplete.asmx (ไม่ต้องสนใจ)

และ PokemonAutoComplete.cs (จะอยู่ใน folder app_code) ให้เราเอาโค้ดด้านล่างนี้ไปแปะที่ PokemonAutoComplete.cs

PokemonAutoComplete.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

using System.Data;

/// <summary>
/// Summary description for PokemonAutoComplete
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
[System.Web.Script.Services.ScriptService] // *** สำหรับสคริปเซอร์วิส ***
public class PokemonAutoComplete : System.Web.Services.WebService {

    public PokemonAutoComplete () {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public string[] GetCompletionList(string prefixText)
    {
        int count = 0;
        PokedexTable pokemon = new PokedexTable();
        DataTable DtPokemon = new DataTable();
        DtPokemon = pokemon.SearchPokemon(prefixText.Trim());

        if (DtPokemon.Rows.Count > 12)
        {
            count = 12;
        }
        else
        {
            count = DtPokemon.Rows.Count;
        }

        List<string> items = new List<string>(count);
        for (int i = 0; i < count; i++)
        {
            items.Add(DtPokemon.Rows[i]["PokemonName"].ToString());
        }

        return items.ToArray();
    }
}


สังเกตที่ [System.Web.Script.Services.ScriptService] ซึ่งเรียกว่าอะไรไม่รู้ ต้องเอา comment ออก

เพื่อใช้งานด้วย จะทำให้ web service นี้สามารถเรียกผ่าน script ของ ajax ได้
Date : 2010-06-24 11:57:00 By : tungman
 


 

No. 18



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


7. สร้าง web form ตั้งชื่อว่า PokemonData.aspx ติ๊กที่ select master page

แล้วเลือก Pokemon.master เป็น master pageแล้วเอาโค้ดด้านล่างไปแปะ

PokemonData.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/Pokemon.master" AutoEventWireup="true" CodeFile="PokemonData.aspx.cs" Inherits="PokemonData" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div style="background: #ffffff; padding: 10px; border: 1px solid black;">
        <table border="0" width="750" cellpadding="5" cellspacing="0">
            <tr valign="top">
                <td rowspan="9" style="width: 300px; text-align: left;">
                    <asp:Image ID="PokemonImage" runat="server" />
                </td>
                <td style="width: 450px;">
                    <asp:Label ID="NameLabel" runat="server" Text="Label"></asp:Label>
                </td>
            </tr>
            <tr valign="top">
                <td><h2>Base stats</h2></td>
            </tr>
            <tr>
                <td>
                	<table class="base-stats">
	                <tbody>
	                <tr>
		                <th>HP</th>
		                <td class="numeric">
                            <asp:Label ID="HpLabel" runat="server" Text="Label"></asp:Label>
                        </td>
		                <td class="graph">
                            <asp:Panel ID="HpPanel" CssClass="barchart" runat="server">
                                <asp:Image ID="HpBarLeft" ImageUrl="~/Images/bar-left.gif" CssClass="left" runat="server" />
                                <asp:Image ID="HpBarRight" ImageUrl="~/Images/bar-right.gif" CssClass="right" runat="server" />
                            </asp:Panel>
		                </td>
	                </tr>
	                <tr>
		                <th>Attack</th>
		                <td class="numeric">
                            <asp:Label ID="AttackLabel" runat="server" Text="Label"></asp:Label>
                        </td>
		                <td class="graph">
                            <asp:Panel ID="AttackPanel" CssClass="barchart" runat="server">
                                <asp:Image ID="AttackBarLeft" ImageUrl="~/Images/bar-left.gif" CssClass="left" runat="server" />
                                <asp:Image ID="AttackBarRight" ImageUrl="~/Images/bar-right.gif" CssClass="right" runat="server" />
                            </asp:Panel>
		                </td>
	                </tr>
	                <tr>
		                <th>Defense</th>
		                <td class="numeric">
                            <asp:Label ID="DefenseLabel" runat="server" Text="Label"></asp:Label>
                        </td>
		                <td class="graph">
                            <asp:Panel ID="DefensePanel" CssClass="barchart" runat="server">
                                <asp:Image ID="DefenseBarLeft" ImageUrl="~/Images/bar-left.gif" CssClass="left" runat="server" />
                                <asp:Image ID="DefenseBarRight" ImageUrl="~/Images/bar-right.gif" CssClass="right" runat="server" />
                            </asp:Panel>
		                </td>
	                </tr>
	                <tr>
		                <th>Sp. Atk</th>
		                <td class="numeric">
                            <asp:Label ID="SpAttLabel" runat="server" Text="Label"></asp:Label>
                        </td>
		                <td class="graph">
                            <asp:Panel ID="SpAttPanel" CssClass="barchart" runat="server">
                                <asp:Image ID="SpAttBarLeft" ImageUrl="~/Images/bar-left.gif" CssClass="left" runat="server" />
                                <asp:Image ID="SpAttBarRight" ImageUrl="~/Images/bar-right.gif" CssClass="right" runat="server" />
                            </asp:Panel>
		                </td>
	                </tr>
	                <tr>
		                <th>Sp. Def</th>
		                <td class="numeric">
                            <asp:Label ID="SpDefLabel" runat="server" Text="Label"></asp:Label>
                        </td>
		                <td class="graph">
                            <asp:Panel ID="SpDefPanel" CssClass="barchart" runat="server">
                                <asp:Image ID="SpDefBarLeft" ImageUrl="~/Images/bar-left.gif" CssClass="left" runat="server" />
                                <asp:Image ID="SpDefBarRight" ImageUrl="~/Images/bar-right.gif" CssClass="right" runat="server" />
                            </asp:Panel>
		                </td>
	                </tr>
	                <tr>
		                <th>Speed</th>
		                <td class="numeric">
                            <asp:Label ID="SpeedLabel" runat="server" Text="Label"></asp:Label>
                        </td>
		                <td class="graph">
                            <asp:Panel ID="SpeedPanel" CssClass="barchart" runat="server">
                                <asp:Image ID="SpeedBarLeft" ImageUrl="~/Images/bar-left.gif" CssClass="left" runat="server" />
                                <asp:Image ID="SpeedBarRight" ImageUrl="~/Images/bar-right.gif" CssClass="right" runat="server" />
                            </asp:Panel>
		                </td>
	                </tr>
	                </tbody>
	                <tbody>
	                <tr>
		                <th>Total</th>
		                <td class="total">
                            <asp:Label ID="TotalLabel" runat="server" Text="Label"></asp:Label>
                        </td>
	                </tr>
	                </tbody>
	                </table>
                </td>

            </tr>
        </table>
    </div>
</asp:Content>

PokemonData.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;

public partial class PokemonData : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["code"] != null)
        {
            PokedexTable pokemon = new PokedexTable();
            DataRow DrPokemon = pokemon.GetPokemonData(Request.QueryString["code"].ToString()).Rows[0];

            PokemonImage.ImageUrl = string.Format("~/PokemonImage.aspx?type=artwork&code={0}", Request.QueryString["code"].ToString());
            
            NameLabel.Text = string.Format("<h1><em>{0}</em>", DrPokemon["PokemonName"].ToString());
            
            HpLabel.Text = DrPokemon["PokemonHp"].ToString();
            HpPanel.Attributes.Add("Style", string.Format("width: {0}px;", (int.Parse(DrPokemon["PokemonHp"].ToString()) + 8).ToString()));

            AttackLabel.Text = DrPokemon["PokemonAttack"].ToString();
            AttackPanel.Attributes.Add("Style", string.Format("width: {0}px;", (int.Parse(DrPokemon["PokemonAttack"].ToString()) + 8).ToString()));

            DefenseLabel.Text = DrPokemon["PokemonDefense"].ToString();
            DefensePanel.Attributes.Add("Style", string.Format("width: {0}px;", (int.Parse(DrPokemon["PokemonDefense"].ToString()) + 8).ToString()));

            SpAttLabel.Text = DrPokemon["PokemonSpAttack"].ToString();
            SpAttPanel.Attributes.Add("Style", string.Format("width: {0}px;", (int.Parse(DrPokemon["PokemonSpAttack"].ToString()) + 8).ToString()));

            SpDefLabel.Text = DrPokemon["PokemonSpDef"].ToString();
            SpDefPanel.Attributes.Add("Style", string.Format("width: {0}px;", (int.Parse(DrPokemon["PokemonSpDef"].ToString()) + 8).ToString()));

            SpeedLabel.Text = DrPokemon["PokemonSpeed"].ToString();
            SpeedPanel.Attributes.Add("Style", string.Format("width: {0}px;", (int.Parse(DrPokemon["PokemonSpeed"].ToString()) + 8).ToString()));

            TotalLabel.Text = string.Format("<strong>{0}</strong>", (int.Parse(DrPokemon["PokemonHp"].ToString()) + int.Parse(DrPokemon["PokemonAttack"].ToString()) + int.Parse(DrPokemon["PokemonDefense"].ToString()) + int.Parse(DrPokemon["PokemonSpAttack"].ToString()) + int.Parse(DrPokemon["PokemonSpDef"].ToString()) + int.Parse(DrPokemon["PokemonSpeed"].ToString())).ToString());

            if (!IsPostBack)
                ((TextBox)Page.Master.FindControl("SearchTextBox")).Text = DrPokemon["PokemonName"].ToString();
        }
    }
}

Date : 2010-06-24 11:59:01 By : tungman
 


 

No. 19



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


8. ลองรันเล่นๆ ดู

1

ลองพิมพ์ ee ลงไป

2

แล้วคลิกปุ่ม จะแสดง list ถ้าคลิกที่ชื่อสามารถไปที่หน้าแสดงรายละเอียดได้

3

แต่ถ้าเลือกใน auto complete

4

จะแสดงรายละเอียดของ pokemon

5
Date : 2010-06-24 12:09:29 By : tungman
 


 

No. 20



โพสกระทู้ ( 297 )
บทความ ( 0 )



สถานะออฟไลน์


ผมทำตามแล้วลอง run ที่หน้า GetPokemon.aspx แล้วไม่มีอะไรเกิดขึ้นเลย
พอไปดูที่ฐานข้อมูล มี PokedexTable สร้างขึ้นมาใหม่ แต่ไม่มีข้อมูลครับ
ทำไมถึงดูดข้อมูลมาไม่ติดครับ พี่ tungman ช่วยตอบทีนะครับ
Date : 2010-09-07 13:36:15 By : nooknoname
 


 

No. 21



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


ลบ table เก่า เพราะถ้ายังอยู่มันจะไม่สร้างและโหลดข้อมูลใหม่

ปล. การสร้าง table จะใช้เวลาสักหน่อยนะ แต่จะช้าเฉพาะครั้งแรก ถ้าลงโปรแกรมตรวจ traffic (du meter)

จะรู้ว่ามัน download ข้อมูล (blob image) มาลง table เป็น 10M เลย ฉะนั้นถ้าเน็ตไม่แรงต้องรอหน่อย

ADSL ผมใช้เวลาเป็น 10 นาที กว่าจะเสร็จ เพราะท่อออกต่างประเทศมันแค่ 512k เอง
Date : 2010-09-07 14:04:59 By : tungman
 


 

No. 22



โพสกระทู้ ( 297 )
บทความ ( 0 )



สถานะออฟไลน์


ไม่มี Error ไรเลยนะครับ page มันขาวแบบนี้มา 1 ชม. แล้ว -*-
ลองลบ PokedexTable แล้ว run ใหม่ แล้วครับก็ยังมะได้ เน็ตผม 5เม็ด ไม่คิกเพิ่ม อะครับ
พี่ tungman มันมี สาเหตุอื่นมั้ย ที่ดูดข้อมูลมาไม่ได้ครับ

GetPokemon

TBPokemon
Date : 2010-09-07 16:17:32 By : nooknoname
 


 

No. 23



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


คงหมดช่วงโปรโมชั่นแล้วแหละครับ

เว็บเขาคงมีระบบป้องกันแล้ว
Date : 2010-09-07 18:13:41 By : tungman
 


 

No. 24



โพสกระทู้ ( 297 )
บทความ ( 0 )



สถานะออฟไลน์


- -* นั่งรอคำตอบทั้งวัน ขอบคุณครับ
พี่ tungman ตั้งกระทู้เกี่ยวกับ AJAX เยอะๆนะครับ น่าสนใจดี
Date : 2010-09-07 18:29:17 By : nooknoname
 


 

No. 25



โพสกระทู้ ( 33 )
บทความ ( 0 )



สถานะออฟไลน์


ลงตามขั้นตอนแล้วถ้าเครื่องมือบ้างอย่างไม่สามารถ
ดึงมาใช้ได้ นี้หมายความว่ายังไงค่ะ แล้วจะปรับอะไร
เพื่อให้ใช้ได้
Date : 2011-04-07 09:41:50 By : cabbage
 


 

No. 26



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

อีกตัวที่น่าสนใจครับ

Go to : ASP.NET Ajax AutoComplete Textbox
Date : 2011-04-07 14:59:32 By : webmaster
 


 

No. 27



โพสกระทู้ ( 28 )
บทความ ( 0 )



สถานะออฟไลน์


รบกวนคุณ tungman ขอไฟล์รวม Base ด้วยค่ะ ถ้าไม่เป็นการรบกวนน่ะค่ะ [email protected] ขอบคุณน่ะค่ะ
Date : 2011-05-31 09:05:42 By : TuckySIS
 


 

No. 28



โพสกระทู้ ( 9 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

น่าสนใจดีครับ / แต่ทำเป็นแบบ VB.Net ได้หรือเปล่าครับ
Date : 2012-07-19 00:33:09 By : somchai243
 


 

No. 29



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Quote:
น่าสนใจดีครับ / แต่ทำเป็นแบบ VB.Net ได้หรือเปล่าครับ


ใช้เว็บแปลงได้ครับ "Convert C# to VB.NET"
Date : 2012-07-19 06:28:19 By : mr.win
 


 

No. 30

Guest


ในหน้า insert data อยากให้ autocomplete เป็น Requifield จะต้อง ใส่ RequifieldValidator อย่างไรครับ
Date : 2012-07-27 18:12:11 By : chon2008
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : [asp.net c#] มาตามคำขอ ajax control toolkit ว่าด้วยเรื่อง autocomplete extender
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 05
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่