Sunday, March 11, 2012

Combining Ajax, ModalPopupExteder and a gridView

You should be able to populate the textboxes using the row at the index in the table at which the edit link is. The markup in the popup is downloaded so setting the textboxes with the content in the row should be possible. If you set the behaviorid on the popup you can retrieve the html element and all the child textboxes easily.

you're losing me.I'm sorry but I am a newbee. I don't know so much.

Can you give me some more details. I've tried using sql commands..to retrieve data from the table, but it didn't work(also because I'm a newbee in asp.net I guess)


Here are some sample codes to useAjax:ModalPopupExtender for your reference.
<div>
<asp:UpdatePanel ID="upnlModalPopup" runat="server">
<ContentTemplate>
TextBox:<asp:TextBox ID="tbPopup" runat="server"></asp:TextBox>
<asp:Panel ID="msgPanel" runat="server">
<table>
<tr>
<td><asp:Label ID="lblUserName0" Text="User Name:" runat="server"></asp:Label></td>
<td><asp:TextBox ID="tbUserName0" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td><asp:Label ID="lblPassword0" Text="Password:" runat="server"></asp:Label></td>
<td><asp:TextBox ID="tbPassword0" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td><asp:Button ID="btnLogon" runat="server" Text="Logon" /></td>
<td><asp:Button ID="btnCancel0" runat="server" Text="Cancel" /></td>
</tr>
</table>
</asp:Panel>
<Ajax:ModalPopupExtender id="ModalPopupExtender" runat="server" TargetControlID="tbPopup" PopupControlID="msgPanel" DropShadow="false">
</Ajax:ModalPopupExtender>
</ContentTemplate>
</asp:UpdatePanel>
</div>
Wish the above can help you.
the thing is that I want that those textboxes to be filled with data from the selected row.
check out 4guysfromrolla.com or gridviewguy.com for gridview tutorials...

No comments:

Post a Comment