Forms Data Controls :: Formview Button Visibility Not Working Correctly?

Apr 17, 2010

I have a formview that displays user info from a dropdownlist. One account may have many users, but one account Primary. I am trying to disable the Edit/Delete button in the formview if the selected ID is the account primary. The problem I get is this.

Step 1: page_load - the primary user is displayed by default, but the delete button is enabled - not right

Step 2: I use the dropdownlist to select another user (not the primary) - everything's fine

Step 3: I then select the Primary User, the Delete Button is disabled - perfect

Step 4: select another user, delete button still disabled - Not right.

[Code]....

1. As you can see my sqlSelect Parameters are bound to the DropDownList.SelectedValue, but is t seems like my if statement for comparing selecteduser to varAdminID doesn't work except once.

So to help debug, i added a label control that displays the selected userID, but on page load the label is blank. but it displays the first record on the list anyway. so if this is the reason for not disabling the delete button on page load then why later does it not reable the button when the user is not the primary, and the UserID is displayed on the label and it is not the primary userid?

View 2 Replies


Similar Messages:

Forms Data Controls :: Toggling Imagebutton Visibility Within A FormView?

Jul 9, 2010

I have a checkbox in a formview in "edit" mode. I want the check to fire an event and toggle a different command imagebutton based on the state of the checkbox. It doesn't seem to be working.

Heres my code.

My Checkbox with oncheckedchanged event

[Code]....

My two image buttons one visible one not visible on intial state

[Code]....

My event subrouting that toggles the button inside of the Formview1

[Code]....

View 6 Replies

Forms Data Controls :: How To Change The Visibility For Update And Edit Button With This Details View

Apr 4, 2010

I have a details view with buttons in the footer. When the user clicks the edit button the calls the ChangeEditMode() method. I want to change the mode of the details view to edit mode which seems to work fine. It goes into edit mode with a text box. I also want it to set the visible property of the edit button to false and set the visible property of the update button to true. Then while still in edit mode the user can click the update button that will call the appropriate method to persist the changes.

I got the changemode() to change to edit but can't change the visible property of the buttons correctly. This is what I have so far. Can some one please tell me what I'm doing wrong?

[Code]....

[Code]....

View 4 Replies

Forms Data Controls :: Button Event Inside ListView Is Not Triggering Correctly?

Mar 16, 2011

I have a ListView (table inside) and it's first row are some TextBoxes for filtering actions.

In the last column I have a button that calls my Search function and filters the records according to the inputs.

[Code]....

My Search function for now only displays a text inside a Label at the top of the page.

When I load the page, I'm using ListViewPesquisa.DataBind() so it shows it's EmptyDataTemplate, but when I click the button inside the event isn't called at all. If I do put some data (any data) in the ListView and it shows it's LayoutTemplate instead, the event is called properly.

I can get around this issue by moving the filter line out of the table, but I'd like to know why is that the button inside the EmptyDataTemplate doesn't work.

View 1 Replies

Web Forms :: CustomValidator Not Triggered In Formview But Working In Normal Submit Button?

Jul 23, 2010

I need to add a customvalidator in a formview insert button.

The following codes works well in normal page submit button, but it couln't work when put in formview, seem like the args.IsValid is not triggered.

<script
runat="server">
Public
Sub CheckSession(ByVal source

[Code]....

View 3 Replies

Forms Data Controls :: FindControl In Formview Not Working

Apr 17, 2010

Can Someone explain why this doesn't work here, when it works in another formview?
[Code]....
I Get Object Reference Not Set, but its all there. I see no reason why it shouldn't work. Same error happens if i remove the first if statement and leave the second it Gives an error on LocationAddButton.Visible = false;

View 4 Replies

Forms Data Controls :: Formview Update Not Working?

Apr 10, 2010

am working with form view for the first time.My issue here is i have an insert item template and edititem template where i have dropdownlist to insert and edit data in to databasemy code below

<asp:FormView ID="fv_ChildPhysicalActivites" runat="server"
DataSourceID="ods_ChildPhysicalActivite"
onitemcommand="fv_ChildPhysicalActivites_ItemCommand"

[code]....

View 5 Replies

Forms Data Controls :: Formview Update Stops Working

Jul 22, 2010

I have a formview and data source that opens in the edit template and allows the user to update a few free form text fields. I also have some drop down boxes that allow a DOB to be built and populate another text box. All of this was working fine yesterday, and today somehow I hosed it and can not find the cause. I have rebuilt this page three times to get it working again, but I can't figure out what I am doing wrong to break it.

[Code]....

Here is the DataSource....

[Code]....

View 4 Replies

Forms Data Controls :: FormView Refresh Schema With ObjectDataSource Not Working

Jan 22, 2011

I'm having a problem with a FormView control that I have bound to an ObjectDataSource. The problem is that the FormView control is not automatically filled in with the public properties of the object linked by an ObjectDataSource control when I select refresh schema. Everything compiles and I can add fields manually, but there are a lot of properties in the class and I do not want to deal with adding all the fields by hand. It's not the end of the world of course if I have to add them manually, but I'm bothered more by the fact that it doesn't act the other formviews.

Has anyone ever experienced a problem like this? I have other objectdatasource controls with other formviews that properly refresh their schemas. I noticed that in the objectdatasource control that is giving me problems, the DataObjectTypeName field is not automatically set as it is in the others. However, after adding it manually it still doesn't refresh the schema. I'm using Visual Studio 2010. Defined in .aspx page:

[Code]....

The SPFModuleBLL class contains the GetModule2() method which is shown here:

[Code]....

View 3 Replies

Forms Data Controls :: Textchange Event Not Working From Textbox On Formview

Oct 6, 2010

I have a formview which in insertmode is required to assign a value to a textbox from another on textchange event. I can't get it working. here's formview code (in bold: event call:

<asp:FormView ID="fvPrecios" runat="server" AllowPaging="True" DataSourceID="OdsPrecios"
Style="position: relative" CellPadding="4" ForeColor="#333333"
DataKeyNames="precnume" >
<EditItemTemplate>
<table style="position: relative" width="400">
<tr>
<td style="width: 62px; height: 26px">
<asp:Label ID="lblEditNombre" runat="server" Text="Nombre"></asp:Label>
</td>
<td style="width: 312px; height: 26px">
<asp:TextBox ID="txtEditNombre" runat="server" Text='<%# Bind("precnomb") %>'></asp:TextBox>
</td>
<td style="width: 2256px; height: 26px">
<asp:Label ID="lblEditPlan" runat="server" Text="Plan"></asp:Label>
</td>
<td style="width: 188px; height: 26px">
<asp:ObjectDataSource ID="odsPlanItem" runat="server" SelectMethod="GetPlanes"
TypeName="Facturacion.DAL.PlanDataLayer"></asp:ObjectDataSource>
<asp:DropDownList ID="ddlPlanEdit" runat="server" DataSourceID="odsPlanItem"
DataTextField="plannomb" DataValueField="plannume"
SelectedValue='<%# Bind("plannume") %>'>
</asp:DropDownList>
</td>
</tr>
<tr>
<td style="width: 62px; height: 21px">
<asp:Label ID="lblEditBasico" runat="server" Text="Basico"></asp:Label>
</td>
<td style="width: 312px; height: 21px">
<asp:TextBox ID="txtEditBasico" runat="server" Text='<%# Bind("precbasi") %>'
ontextchanged="txtNewBasico_TextChanged"></asp:TextBox>
</td>
<td style="width: 2256px; height: 21px">
<asp:Label ID="lblEditRecargo" runat="server" Text="Recargo"></asp:Label>
</td>
<td style="width: 188px; height: 21px">
<asp:TextBox ID="txtEditRecargo" runat="server" Text='<%# Bind("precreca") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 62px">
<asp:Label ID="lblEditTotal" runat="server" Text="Total"></asp:Label>
</td>
<td style="width: 312px">
<asp:UpdatePanel ID="UpTotal" runat="server">
<ContentTemplate>
<asp:TextBox ID="txtEditTotal" runat="server" Text='<%# Bind("prectota") %>'
ReadOnly="True"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td style="width: 2256px">
<asp:Label ID="lblEditInicial" runat="server" Text="Inicial"></asp:Label>
</td>
<td style="width: 188px">
<asp:TextBox ID="txtEditInicial" runat="server" Text='<%# Bind("precinic") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 62px">
<asp:Label ID="lblEditSaldo" runat="server" Text="Saldo"></asp:Label>
</td>
<td style="width: 312px">
<asp:TextBox ID="txtEditSaldo" runat="server" Text='<%# Bind("precsald") %>'></asp:TextBox>
</td>
<td style="width: 2256px">
<asp:Label ID="lblEditCuota" runat="server" Text="Cuota"></asp:Label>
</td>
<td style="width: 188px">
<asp:TextBox ID="txtEditCuota" runat="server" Text='<%# Bind("preccuot") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 62px">
<asp:Label ID="lblEditConsignado" runat="server" Text="Consignado"></asp:Label>
</td>
<td style="width: 312px">
<asp:TextBox ID="txtEditConsignado" runat="server"
Text='<%# Bind("preccons") %>'></asp:TextBox>
</td>
<td style="width: 2256px">
<asp:Label ID="lblEditRetenido" runat="server" Text="Retenido"></asp:Label>
</td>
<td style="width: 188px">
<asp:TextBox ID="txtEditRetenido" runat="server" Text='<%# Bind("precrete") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 62px">
<asp:Label ID="lblEditComision" runat="server" Text="Comision"></asp:Label>
</td>
<td style="width: 312px">
<asp:TextBox ID="txtEditComision" runat="server" Text='<%# Bind("preccomi") %>'></asp:TextBox>
</td>
<td style="width: 2256px">
<asp:Label ID="lblEditActivo" runat="server" Text="Activo"></asp:Label>
</td>
<td style="width: 188px">
<asp:RadioButtonList ID="rblactivo" runat="server" RepeatDirection="Horizontal"
SelectedValue='<%# Bind("precacti") %>'>
<asp:ListItem Value="S">Si</asp:ListItem>
<asp:ListItem Value="N">No</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td style="width: 62px">
</td>
<td style="width: 312px">
</td>
<td style="width: 2256px">
</td>
<td style="width: 188px">
</td>
</tr>
<tr>
<td align="center" colspan="4">
<asp:Button ID="btnInsertar" runat="server" CommandName="Update"
Text="Guardar" />
<asp:Button ID="btnCancel" runat="server" CommandName="Cancel" Text="Cancel" />
</td>
</tr>
<tr>
<td style="width: 62px">
</td>
<td style="width: 312px">
</td>
<td style="width: 2256px">
</td>
<td style="width: 188px">
</td>
</tr>
</table>
</EditItemTemplate>
<PagerTemplate>
<asp:LinkButton ID="btnFirst" runat="server" CommandName="Page" CommandArgument="First">Primera</asp:LinkButton>
<asp:LinkButton ID="btnPrev" runat="server" CommandName="Page" CommandArgument="Prev">Anterior</asp:LinkButton>
Pagina:<%#fvPrecios.PageIndex &#43; 1%>
<asp:LinkButton ID="btnNext" runat="server" CommandName="Page" CommandArgument="Next">Siguiente</asp:LinkButton>
<asp:LinkButton ID="btnLast" runat="server" CommandName="Page" CommandArgument="Next">Ultima</asp:LinkButton>
</PagerTemplate>
<InsertItemTemplate>
<table style="position: relative" width="400">
<tr>
<td style="width: 62px; height: 26px">
<asp:Label ID="lblNewNombre" runat="server" Text="Nombre"></asp:Label>
</td>
<td style="width: 312px; height: 26px">
<asp:TextBox ID="txtNewNombre" runat="server" Text='<%# Bind("precnomb") %>'></asp:TextBox>
</td>
<td style="width: 2256px; height: 26px">
<asp:Label ID="lblNewPlan" runat="server" Text="Plan"></asp:Label>
</td>
<td style="width: 188px; height: 26px">
<asp:DropDownList ID="DdPlan" runat="server" DataSourceID="OdsPlan"
DataTextField="plannomb" DataValueField="plannume" SelectedIndex='<%# Bind("plannume") %>'
SelectedValue='<%# Bind("plannume") %>' Font-Size="Small">
</asp:DropDownList>
<asp:ObjectDataSource ID="OdsPlan" runat="server" SelectMethod="GetPlanes"
TypeName="Facturacion.DAL.PlanDataLayer" InsertMethod="Insert"
OldValuesParameterFormatString="original_{0}">
<InsertParameters>
<asp:Parameter Name="plannomb" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
</td>
</tr>
<tr>
<td style="width: 62px; height: 21px">
<asp:Label ID="lblNewBasico" runat="server" Text="Basico"></asp:Label>
</td>
<td style="width: 312px; height: 21px">
<asp:TextBox ID="txtNewBasico" runat="server" Text='<%# Bind("precbasi") %>'
OnTextChanged="txtNewBasico_TextChanged"></asp:TextBox>
<ajaxToolkit:MaskedEditExtender runat="server" ID="txtNewBasico_MaskedEditExtender" TargetControlID="txtNewBasico"
Mask="9'999,999"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="Number"
InputDirection="RightToLeft"
ErrorTooltipEnabled="True">
</ajaxToolkit:MaskedEditExtender>
</td>
<td style="width: 2256px; height: 21px">
<asp:Label ID="lblNewRecargo" runat="server" Text="Recargo"></asp:Label>
</td>
<td style="width: 188px; height: 21px">
<asp:TextBox ID="txtNewRecargo" runat="server" Text='<%# Bind("precreca") %>' ></asp:TextBox>
<ajaxToolkit:MaskedEditExtender runat="server" ID="MaskedEditExtender1" TargetControlID="txtNewRecargo"
Mask="9'999,999"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="Number"
InputDirection="RightToLeft"
ErrorTooltipEnabled="True">
</ajaxToolkit:MaskedEditExtender>
</td>
</tr>
<tr>
<td style="width: 62px">
<asp:Label ID="lblNewTotal" runat="server" Text="Total"></asp:Label>
</td>
<td style="width: 312px">
<asp:UpdatePanel ID="UpdTotal" runat="server">
<ContentTemplate>
<asp:TextBox ID="txtNewTotal" runat="server" Text='<%# Bind("prectota") %>'></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td style="width: 2256px">
<asp:Label ID="lblNewInicial" runat="server" Text="Inicial"></asp:Label>
</td>
<td style="width: 188px">
<asp:TextBox ID="txtInicial" runat="server" Text='<%# Bind("precinic") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 62px">
<asp:Label ID="lblNewSaldo" runat="server" Text="Saldo"></asp:Label>
</td>
<td style="width: 312px">
<asp:TextBox ID="txtNewSaldo" runat="server" Text='<%# Bind("precsald") %>'></asp:TextBox>
</td>
<td style="width: 2256px">
<asp:Label ID="lblNewCuota" runat="server" Text="Cuota"></asp:Label>
</td>
<td style="width: 188px">
<asp:TextBox ID="txtCuota" runat="server" Text='<%# Bind("preccuot") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 62px">
<asp:Label ID="lblNewConsignado" runat="server" Text="Consignado"></asp:Label>
</td>
<td style="width: 312px">
<asp:TextBox ID="txtNewConsignado" runat="server"
Text='<%# Bind("preccons") %>'></asp:TextBox>
</td>
<td style="width: 2256px">
<asp:Label ID="lblNewRetenido" runat="server" Text="Retenido"></asp:Label>
</td>
<td style="width: 188px">
<asp:TextBox ID="txtNewRetenido" runat="server" Text='<%# Bind("precrete") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 62px">
<asp:Label ID="lblNewComision" runat="server" Text="Comision"></asp:Label>
</td>
<td style="width: 312px">
<asp:TextBox ID="txtNewComision" runat="server" Text='<%# Bind("preccomi") %>'></asp:TextBox>
</td>
<td style="width: 2256px">
</td>
<td style="width: 188px">
</td>
</tr>
<tr>
<td style="width: 62px">
</td>
<td style="width: 312px">
</td>
<td style="width: 2256px">
</td>
<td style="width: 188px">
</td>
</tr>
<tr>
<td align="center" colspan="4">
<asp:Button ID="btnInsertar" runat="server" CommandName="Insert"
Text="Guardar" />
<asp:Button ID="btnCancel" runat="server" CommandName="Cancel" Text="Cancel" />
</td>
</tr>
<tr>
<td style="width: 62px">
</td>
<td style="width: 312px">
</td>
<td style="width: 2256px">
</td>
<td style="width: 188px">
</td>
</tr>
</table>
</InsertItemTemplate>
now codebehind:
protected void Page_Load(object sender, EventArgs e)
{
}
protected void txtNewBasico_TextChanged(object sender, EventArgs e)
{
if(fvPrecios.CurrentMode == FormViewMode.Insert)
TextBox txtTotal = (TextBox)fvPrecios.Row.FindControl("txtNewTotal");
TextBox txtBasico = (TextBox)fvPrecios.Row.FindControl("txtNewBasico");
TextBox txtRecargo = (TextBox)fvPrecios.Row.FindControl("txtNewRecargo");
txtTotal.Text = "hola";
}

View 3 Replies

Forms Data Controls :: Formview Insert - Prefilled Data Not Working?

Jan 31, 2011

Two text boxes on a formview need to be prefilled with data (coming from session variables) on page load. The formview is in Insert mode by default. Is that the reason why it shows blank fields...

How do I get two fields filled in with data on page load.. the user will enter the rest of the fields and Click on Insert.

[Code]....

I put break points and saw that the data was coming in as expected...but when the page loads with formview, the text boxes do not show any data.

View 2 Replies

Forms Data Controls :: Formview Paging Not Working With Objectdatasource And Viewstate Setup?

Oct 7, 2010

I was able to get the formview bound to the objectdatasource, it works great for the first record, but when i select the next record it gives me error below is all my code, if there is something else that i need to post .

[Code]....

View 3 Replies

Changing Visibility Of Panel Inside Formview?

Dec 28, 2010

I have a panel inside a formview that is supposed to become visible when a checkbox (also inside the formview) is checked. I am able to access the controls, but I'm not sure how to actually make it work. This is my codebehind so far, I know it's not right, but it gives a basic idea of what I'm trying to do.

Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView1.DataBound
If FormView1.CurrentMode = FormViewMode.Edit Then
Dim checkGenEd As CheckBox = FormView1.FindControl("checkGenEd")
Dim panelOutcome As Panel = FormView1.FindControl("panelOutcome")
If checkGenEd.Checked = True Then
panelOutcome.Visible = True
Else
panelOutcome.Visible = False
End If
End If
End Sub

View 1 Replies

Forms Data Controls :: How To Hide Edit Button In FormView

Feb 27, 2010

There is a dropdown with two status (Cleared, Pending) in the formview.

I want to hide Edit button of the form if the dropdown displays Cleared. So that the user may not edit further in the data.

View 12 Replies

Forms Data Controls :: Delete Button In Formview Not Going Invisible?

Apr 4, 2010

I am trying to update my Fromview Delete button to Visible = false, if a record in another related table is inhabited.

But I keep getting errors, or it is still visible even though I know that there is not a record.

[Code]....

So here is what happens, First the Gridview sets the pageIndex of the Formview then

I want it to read from the customer_contacts table and if the SelectedValue (LocationID) is in a table ie if there is a contact assigned to this location, I don't want them to be able to delete the location until they have reassigned the contact to a new locationID, and If there is only 1 location on record, they cannot delete either.

View 3 Replies

Forms Data Controls :: Using A Formview To Update A Database With A Insert Button

Jan 5, 2011

I am *VERY* new to ASP.net. This may seem simple to you all, but I'm really lost. I have a small sized page with three text boxes (part of the InsertItemTemplate) of a formview, and a slightly modified link the system generated to submit the data to be inserted in the database:

[Code]....

If this page is run, it inserts the data into the database fine, clears the form and sits there. I want it to return a simple "Thank you" page in a window of the same size, with a Close Window buttom at the bottom to close the window:

[Code]....

When I set the postbackurl property on the first page, everything appears to work, except the write is never done to the database. If I remove the postback, it works as it did previously.

View 1 Replies

Forms Data Controls :: Access Itemcommand Event With Button Outside Formview?

Mar 18, 2010

I have a formview and a few buttons outside the formview. How can i access the formview.itemcommand event if the buttons are not in the formview?

View 9 Replies

Forms Data Controls :: Button To Display Data In Formview?

Aug 15, 2010

I'm receiving an error when I write some text in a text box then use a button to display the data in a form view after it finds the record in the database. Other word, I have a textbox as a search then the button to search the database to display the results in a form view. I do have an autocomplete in ajax which comes up with the correct information. The following is my code. For some reason its not working. Instead I get the an error.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="SearchByCompany.aspx.vb" Inherits="Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<script runat="server">

[Code]....

View 6 Replies

Forms Data Controls :: Disabling All Controls In A Formview On Button Click?

Nov 9, 2010

I am facing some problem with fromview....

I want enable or disable all controls once i click on hold button..and need to enable on unhold button...

I do know how to do using findcontrol by setting each control...but I do have 10 to 20 textboxes and dropdownslists in my formview...so do like that doesn't make any sense if do we have a way to disable/enable all at once....

How to disable all textboxes, dropdownlists etc.

View 4 Replies

Forms Data Controls :: Remove Edit Button In Formview Item Template?

Mar 27, 2010

I wish to remove the edit button in the formview item template if a particular user is not authorized, how do you accomplish the removal?

View 6 Replies

Forms Data Controls :: FormView - Button Requires 2 Click To Fire The Event?

Oct 4, 2010

I have a modal formview with insertitemtemplate. I have to click the insert button twice to fire the event.

But if I do not insert any values, only one click is required and the validationgroup fires. But if I enter all valid values, I need to click twice and the event does not fire during the first click. But I need CausesValidation = false because to required field validators.

How to avoid two clicks to fire the event if the formview is valid

[Code]....

View 2 Replies

Forms Data Controls :: Formviews And Code - Disable The edit Button In Formview?

Apr 16, 2010

I have a very complex page with 11 formviews, 1 dropdownlist, and 11 sqlDataSources.I have several issues

Page: This page controls my website users and their info. There are 2 different users with 3 different permissions; users - 1 Primary(account Creator), and the rest; Permissions - View, Edit(Manage), Create/Delete(Author)

Each Formview controls one column in the table.

1st. After Permissions are read, the add, delete buttons are to be disabled if no permission. If the User selected is the PrimaryUser the delete button is disabled. On Page load, the delete button is enabled even though the displayed user is the Primary, when you select another user, then select the primary again, the delete button is disabled, but when you select another user the delete button is still disabled. This should not be!

2nd. I then added a check to see if there was one or more locations, and if there is only one, then disable the edit button that allows a user to assign a user to a specific location. example: if there are 3 locations, you may assign a user to that office location, but if there is only one location, there is no need. I try to disable the edit button in formview, but I get "object reference not set to instance" which is total cr#$ because the button is there in the form.

3rd. When a page loads and all of your sqlDataSources have a Select controlParameter that is determined by a DropDownList, how is the initial record determined other than it is the first record?No matter how I work my code, these issues do not work, and it is very frustrating and holding my project back. I have been working on thes for a week.

[Code]....

View 2 Replies

Forms Data Controls :: Selected Value Of RadioButtonList Inside A Formview Get Cleared On Button Click?

Sep 13, 2010

I placed a RadioButtonList inside a Formview control.And from DataBound event handler oformview ,RadioButtonList is binded to the datasource .Now my problem is after selecting a value from radiobuttonlist and I click any button,the radiobuttonList get unchecked and lose the selected value .How can I avoid this.

View 1 Replies

Forms Data Controls :: Handling A Null Value In Textbox FormView (on Button Click To Calculate Totals)

Mar 17, 2011

I have a rather large formview that asks for a variety of input values (physical totals vs pos report totals). I have created vb code to calculate the differences and subtotals of various types prior to inserting the data so people can check for entry errors.

Its a closing reconciliation form. Here's the problem: If they forget to enter 0 in a field that doesn't have any totals, a big ugly error message displays. I would like to avoid this. I can tell them until I am blue in the face to remember to enter 0 and not leave any blank fields, but realistically its going to happen and I need to handle it in the programming.

I have been struggling to either default the values to zero to start with, replace a null textbox with 0 before the calculate runs...but I can't get anything to really work. What is the best way to handle this?

Here is the aspx page:

[Code]....

And the code behind page with working "Calculate" as long as fields are not left blank (I took out all the test code that made it not work at all)

[Code]....

Finally, the error message I am getting is the following:

[Code]....

I can't seem to find the right combination of programming to account for the "" string to be 0 so that it will add or subtract values in my calculate. I have my sql table setup with default values of 0 so if a field is left blank it will be entered into the database as 0 and not null. It is really just for my inserting of a reconciliation and the running of Calculate Totals to double check their work prior to inserting into the database.

View 1 Replies

AJAX :: Two Update Panels Interfacing With External Button - How To Control Button Visibility

Jun 15, 2010

I have a page with 2 update panels

UpdatePanel1 contains a gridview1 and a standard panel, pnlForms. gridview1 has a linkbutton which is processed in the gridview1_rowcommand

UpdatePanel2 has gridview2.

There is also a Submit button that isn't in either UpdatePanel but may be a candidate to go into its own UpdatePanel. The Submit button is a trigger for both update panels

The behavior I would like is:

1-Initially, all visible except pnlForms and Submit button 2- When linkbutton in UpdatePanel1 gridview1 is clicked, pnlForms and Submit button become visible. 3. When Submit button is clicked, both gridviews should be refreshed, and PnlForms and the Submit button should both become not visible. I believe I may have to put the Submit button in its own UpdatePanel3 but am not sure how to proceed.

In my present code, everything works as desired except Submit button (not presently in any Update panel) is always visible. Assuming Submit button is initialized to not visible, how do I get it to appear when I click the link button in gridview1 and to disappear when it is clicked?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved