如何将按钮的行为设置为与asp.net中的其他按钮相同.详细信息如下:--- [英] How the button behaviour is set to same as other button in asp.net.The detail is given below:---

查看:65
本文介绍了如何将按钮的行为设置为与asp.net中的其他按钮相同.详细信息如下:---的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我想告诉您在数据库SQL Server中,这三个字段是应用名称,雇员名称,雇员地址.

现在:---

我选择了一个名称为"A"的按钮.我也选择了一个链接按钮名称
现在,我希望当我选择按钮"A"时选择另一个链接按钮全部"
仅从数据库中选择名称为"A"的雇员名称.

这表示链接按钮全部"的行为与按钮"A"类似.
请记住,链接按钮全部"仅从数据库中选择名称为"A"的雇员名称.
但是按钮"A"的映射或行为类似于链接按钮全部",但不能用于从数据库中选择雇员名称.

因此,请给出正确的答案.
aspx代码为:___

Firstlt I want to tell u Thae In database SQL Server ,The three fields are employeid,employename,employeaddress.

Now:---

I have taken a button which have name "A".I have also taken a link button name
"All".Now I want that when I select the button "A" then another link button "All"
only select the employename which have name "A" from the database.

It mean to say that link button "All" is behavioung like the button "A".
Remember that link button "All" only select the employename which have name "A" from the database.
But button "A" is mapped or behavioung like the link button "All" but not use for the select the employename from the database.

So give the proper answer.
The aspx code is:___

<form id="form1" runat="server">
    <div>

        <table width="100%" border="1">
        <tr>
        <td >
  <asp:Button ID="btnA" runat="server" Text="A" Width="42px" onclick="btnA_Click"

                oncommand="btnA_Command"/>















<asp:LinkButton ID="lnkbtnAll" runat="server" Font-Underline="False"

                                onclick="lnkbtnAll_Click">All</asp:LinkButton>



.cs代码为:----



The .cs code is:----

protected void btnA_Click(object sender, EventArgs e)
   {
    }
protected void lnkbtnAll_Click(object sender, EventArgs e)
    {
        try
        {
         {
                string str = "a";
                string connectionString = WebConfigurationManager.ConnectionStrings["cnn"].ConnectionString;
                string selectSQL = "SELECT emplastname FROM emppersonalinfo  where emplolyename Like '" + str + "%'";
                SqlDataAdapter adp = new SqlDataAdapter(selectSQL, cnn);
                DataSet ds = new DataSet();
                adp.Fill(ds);
                Panel1.Visible = true;
                DataList1.DataSource = ds;
                DataList1.DataBind();
            }

        }
         catch (Exception ex)
        {
            Response.Write(ex.ToString());
        }
       

    }

推荐答案



您的意思是选择"A".在该事件中的操作.

让我猜更多...

如果选择B,则链接按钮全部"从名称为"B"的数据库中检索数据.

如果我正确,请尝试以下行

Hi,

what you mean select "A".what you do in that event.

Let me guess some more...

If you select B then link button "All" retrieve data from database which have name "B".

If I correct try this line

string query="select * from TableName where employeeename='"+A.ID+"'";




最好的




All the Best


这篇关于如何将按钮的行为设置为与asp.net中的其他按钮相同.详细信息如下:---的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆