\" SelectCommand=\"SELECT DISTINCT [firstname], [middlename], [lastname], [mobile], [city], [title], [enquirym" />
开发者

popup on gridview link button

开发者 https://www.devze.com 2023-02-28 07:39 出处:网络
this is aspx page code \' OnClick=\"lnkCustomer\"> \" SelectCommand=\"SELECT DISTINCT [firstname], [middlename], [lastname], [mobile], [city], [title], [enquirym

this is aspx page code

' OnClick="lnkCustomer"> " SelectCommand="SELECT DISTINCT [firstname], [middlename], [lastname], [mobile], [city], [title], [enquirymasterid] FROM [EnquiryMaster]">

*I have written this code behind link button in gridview but the popup doesnt sho*w

protected void lnkCustomer(object sender, EventArgs e)
   {
       //Retrieve Customer ID
       LinkButton lnkCustomerID = sender as LinkButton;
       string strCustomerID = lnkCustomerID.Text;

       //Create sql connection and fetch data from database based on CustomerID
       string strConnectionString = ConfigurationManager.ConnectionStrings["connstring"].ConnectionString;
       string strSelect = "SELECT DISTINCT [firstname], [middlename], [lastname], [mobile], [city], [title], [enquirymasterid] FROM [EnquiryMaster] WHERE enquirymasterid = @enquirymasterid";
       SqlConnection sqlCon = new SqlConnection();
       sqlCon.ConnectionString = strConnectionString;
       SqlCommand cmdCustomerDetails = new SqlCommand();        
            cmdCustomerDetails.Connection = sqlCon;
        cmdCustomerDetails.CommandType = System.Data.CommandType.Text;
        cmdCustomerDetails.CommandText = strSelect;
        cmdCustomerDetails.Parameters.AddWithValue("@enquirymasterid", strCustomerID);
       sqlCon.Open();

       //Create DataReader to read the record
        SqlDataReader dReader = cmdCustomerDetails.ExecuteReader();
      开发者_运维知识库 GridView2.DataSource = dReader;
        GridView2.DataBind();
        sqlCon.Close();
        modalPopUpExtender1.Show();
}


The 'calling' button should be inside a updatepanel, read this blogpost (You might wanna consider not using the ajaxcontroltoolkit at all and switch to a jquery based solution)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号