Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CommandField Type Select
Message
Information générale
Forum:
ASP.NET
Catégorie:
WebForms
Versions des environnements
Environment:
ASP.NET
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01303034
Message ID:
01303096
Vues:
16
This message has been marked as a message which has helped to the initial question of the thread.
>>>Hi everybody,
>>>
>>>I have a GridView on the form with the Select button
>>>
>>>
>>> <asp:CommandField SelectText="Edit" ShowSelectButton="True" />
>>>
>>>Now, I want to hide the grid when I press it and show the information from the table.
>>>
>>>I had it working correctly using server side code. But I decided to change my approach and do it from the client side.
>>>
>>>I added two DIV tags GridInfo and ProfileInfo around my grid and table correspondignly.
>>>
>>>My problem now is to inject the JavaScript into the Select button. Since it doesn't have ID I'm at lost as how to do it.
>>>
>>>Any ideas, please?
>>>
>>>Thanks a lot in advance.
>>
>>Give it an ID. If the button is in the grid (and this is the same grid you're firing the ItemDataBound event in), you can use code similar to what you're already doing for the linkbutton, ex.
>>
>>
>>Button myButton = e.Item.FindControl("ID of button") as Button;
>>
>>
>>You can also set it's javascript the same way as the link.
>
>Right, except that this button doesn't have an ID attribute.

That's what I'm saying - set it. If it's inside of a grid, ASP.NET is going to mangle it so it's unique. On the server side use the FindControl() method to find the control based on it's original ID.

>Anyway, I switched to server side code for this. The Client code was not working for me, it changed the display and then something was changing it again.

Sorry, I thought this was server side?
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform