开发者

Multiple Button in a single view

I have a web project which includes two button in a vie开发者_如何转开发w.when i click a button some textboxes along with that second button have to be visible.After entering data in textboxes,when i am trying to click the second button, its not working.What should i do to make it work? Thanks in advance.


Rahul try this

In aspx page

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
        <asp:Button ID="Button2" runat="server" Text="Button" onclick="Button2_Click" />

In aspx.cs page

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Button2.Visible = false;
            TextBox1.Visible = false; 
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Button2.Visible = true;
        TextBox1.Visible = true;
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        TextBox1.Text = "Testing";
    }
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜