Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to pass ClientID in OnClientClick
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01301882
Message ID:
01302696
Views:
23
>>Now for some reason the previously working correctly code doesn't work anymore:
>
>Set the command argument to "RemUser".
>
>
> protected void grdvwUsers_RowDataBound(object sender, GridViewRowEventArgs e)
>    {
>        if (e.Row.DataItem != null)
>        {
>            LinkButton link = e.Row.FindControl("lnkbtnRemoveRole") as LinkButton;
>            if (link != null)
>            {
>                link.CommandArgument = "RemUser";
>
>
>
>>Do you know why does it affect the other code and how can I have them both working? Or what code should I use when I click on the Remove User button (originally it was not a linkbutton).
>
>Different controls have different properties. Since you're probably not setting the CommandArgument in the ASPX page anymore, you need to set them in the code-behind.

I'm setting it in ASPX. My code in RowCommand does go to RemUser, but it gives an error on

int index = Convert.ToInt32(args.CommandArgument);

line.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform