Click here to Skip to main content
15,900,598 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to add the code like
C#
if (takingLimit > cal_Taken)
   {
        errdv.Style.Add("display", "block");
        errdv.InnerHtml = "You can take only " + cal_Taken.ToString() + " Reward." + "Do    You Want To Continue <asp:LinkButton id='myid'  runat='server'
        OnClick='Yes_Click' >Yes</asp:LinkButton>" + "<a href='#'
        runat='server'  önserverclick='Cancel_Click' id='cancel' >  Cancel</a>"
   }

None of links are working. Can anyone tell me what I am doing wrong?
Posted
Updated 17-May-13 5:15am
v4
Comments
Thanks7872 17-May-13 7:32am    
errdv.Style.Add("display", "block");
errdv.InnerHtml = "You can take only " + cal_Taken.ToString() + " Reward." +
"Do You Want To Continue <asp:LinkButton id='myid' runat='server' OnClick='Yes_Click' >Yes" +
"<a href='#' runat='server' OnClick='Cancel_Click' id='cancel' >Cancel";
Miss Maheshwari 17-May-13 7:36am    
sorry wat u want to say....didn't get u???
Thanks7872 17-May-13 8:14am    
copy paste the code i provided.I hope it should work.If it wont,let me know.

1 solution

Below is the sample code. Please try this approach
protected void Page_Load(object sender, EventArgs e)
    {
        Literal lit = new Literal();
        lit.Text = "You can take only Reward.Do You Want To Continue";
        errdv.Controls.Add(lit);

        LinkButton linBtn = new LinkButton();
        linBtn.ID = "myid";
        linBtn.Text = "Yes";
        linBtn.Click += Yes_Click;
        errdv.Controls.Add(linBtn);

        linBtn = new LinkButton();
        linBtn.ID = "CancelBtn";
        linBtn.Text = "Cancel";
        linBtn.Click += Cancel_Click;
        errdv.Controls.Add(linBtn);
    }

    protected void Yes_Click(object sender, EventArgs e)
    {
    }
    protected void Cancel_Click(object sender, EventArgs e)
    {
    }
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900