CopyPastor

Detecting plagiarism made easy.

Score: 0.7558032456168368; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2016-11-02
by Rajshee IFour

Original Post

Original - Posted on 2016-11-01
by Stacked



            
Present in both answers; Present only in the new answer; Present only in the old answer;

I think you are missing **Button button = (sender as Button) and String userId = button.CommandArgument** in your code. you can try following to make it working.
<asp:Button ID="AddUserButton" CssClass="btn btn-danger btn-block" runat="server" Text="Add User" onclick="AddUserButton_Click" Commandargument="<%# Eval("User_Id") %>"/> protected void AddUserButton_Click(object sender, EventArgs e) { String projectId = Request.QueryString["Project_id"]; Button button = (sender as Button); String userId = button.CommandArgument; }
In your ASPX add a `CommandArgumand` attribute to your button that will hold the user id:
<asp:Button ID="AddUserButton" CssClass="btn btn-danger btn-block" runat="server" Text="Add User" onclick="AddUserButton_Click" Commandargument="<%# Eval("User_Id") %>"/>
In your code behind, use the value passed in the `CommandArgument`:
protected void AddUserButton_Click(object sender, EventArgs e) { String projectId = Request.QueryString["Project_id"]; String userId = e.CommandArgument; }

        
Present in both answers; Present only in the new answer; Present only in the old answer;