Hi,
I am hoping someone on this forum would be able to help me.
I have a radgrid with Edit form set up as pop up. I am using an "on-click" event for my update/insert buttons on the form template.
However, I am unable to access the controls on the form from the code behind onclick function. Can someone please tell me how I'd be able to access the controls.
Here is my EditForm in my aspx:
<EditFormSettings InsertCaption="New Request" CaptionDataField="RequestID" EditFormType="Template">
<FormTemplate>
<table id="Table1" cellspacing="1" cellpadding="1" width="800px" border="0" >
<tr>
<td colspan="4">
</td>
</tr>
<td>
Request Name:
</td>
<td>
<asp:TextBox ID="txtReqName" runat="server" Text='<%# Bind( "Request_Name") %>' TabIndex="1" >
</asp:TextBox>
</td>
</tr>
</table>
<table style="width: 100%">
<tr>
<td align="center" colspan="2">
<asp:Button ID="btnUpdate" OnClick = "InsertOrUpdate" Text='<%# Iif (TypeOf Container is GridEditFormInsertItem, "Add", "Update") %>'
runat="server" CommandName='<%# Iif (TypeOf Container is GridEditFormInsertItem, "Insert", "Update") %>'>
</asp:Button>
<asp:Button ID="btnCancel" OnClick = "CancelUpdate" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
</asp:Button>
</td>
</tr>
</table>
</FormTemplate>
<PopUpSettings Height="600" Width="800" CloseButtonToolTip="Cancel" Modal = "true" />
</EditFormSettings>
And here is my code behind:
Protected Sub InsertOrUpdate(ByVal sender As Object, ByVal e As EventArgs)
' How can I access the control txtReqName here and obtain it's value.
End Sub
Appreciate any help. Thanks!
I am hoping someone on this forum would be able to help me.
I have a radgrid with Edit form set up as pop up. I am using an "on-click" event for my update/insert buttons on the form template.
However, I am unable to access the controls on the form from the code behind onclick function. Can someone please tell me how I'd be able to access the controls.
Here is my EditForm in my aspx:
<EditFormSettings InsertCaption="New Request" CaptionDataField="RequestID" EditFormType="Template">
<FormTemplate>
<table id="Table1" cellspacing="1" cellpadding="1" width="800px" border="0" >
<tr>
<td colspan="4">
</td>
</tr>
<td>
Request Name:
</td>
<td>
<asp:TextBox ID="txtReqName" runat="server" Text='<%# Bind( "Request_Name") %>' TabIndex="1" >
</asp:TextBox>
</td>
</tr>
</table>
<table style="width: 100%">
<tr>
<td align="center" colspan="2">
<asp:Button ID="btnUpdate" OnClick = "InsertOrUpdate" Text='<%# Iif (TypeOf Container is GridEditFormInsertItem, "Add", "Update") %>'
runat="server" CommandName='<%# Iif (TypeOf Container is GridEditFormInsertItem, "Insert", "Update") %>'>
</asp:Button>
<asp:Button ID="btnCancel" OnClick = "CancelUpdate" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
</asp:Button>
</td>
</tr>
</table>
</FormTemplate>
<PopUpSettings Height="600" Width="800" CloseButtonToolTip="Cancel" Modal = "true" />
</EditFormSettings>
And here is my code behind:
Protected Sub InsertOrUpdate(ByVal sender As Object, ByVal e As EventArgs)
' How can I access the control txtReqName here and obtain it's value.
End Sub
Appreciate any help. Thanks!