I set Breakpoint on button event
when i clicked on button first time it didnt happen any thing when i clicked for second time it went to VS and show button click event where i set breakpoint and in Intelli Trace wrote every thing that i worte in my last reply
this is my code in search.aspx
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class mainsearch : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection _cn = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["behtopConnectionString"].ConnectionString);
SqlCommand _cm2 = new SqlCommand("Trade", _cn);
_cm2.CommandType = CommandType.StoredProcedure;
_cm2.Parameters.Add("@Keyword", txtsearch.Text);
if (_cn.State != System.Data.ConnectionState.Open) _cn.Open();
SqlDataReader _dr = _cm2.ExecuteReader();
while (_dr.Read())
{
GridView1.DataSource = _dr;
GridView1.DataBind();
}
if (_cn.State != System.Data.ConnectionState.Closed) _cn.Close();
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
string Code = (sender as LinkButton).CommandArgument;
string T_Code = Code.Split('_')[0];
string F_Code = Code.Split('_')[1];
if (T_code == "11")
{
Response.Redirect(string.Format("furniture.aspx?Code={0}",F_Code));
}
if (T_code == "33")
{ Response.Redirect("book.aspx");
}
}
}