.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Resetting the default value of a control when a check box is returned to False (unchecked)

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :C#

Let me start by saying I’m new at programming InfoPath and I value the advice I have found in this forum. Thank you...

 Here’s my situation: I have an InfoPath 2007 form that populates a SharePoint list once the form is submitted. On the form I have various textboxes that are conditionally formatted to remain hidden until an associated checkbox is checked (value of True).  All is good so far. 

The situation I have is if the user decides after populating a textbox they really didn’t need to fill in that textbox and the checkbox is unchecked (value of False), the textbox is hidden once again but the information remains in the textbox.  Thus, when the user submits the form the unneeded information is submitted as well.  

I would think returning a textbox control to its default value could be accomplished wi

View Complete Post

More Related Resource Links

check box control


Hi ,

I have a three check box in my web form ,i need to choose only one check box, if i choose one check box

another 2 check box automatically unchecked

can i use jquery for check box

"Access is denied. Check that the Default Content Access Account has access to this content"


Our search is not working. The crawl log indicates following error: "Access is denied. Check that the Default Content Access Account has access to this content, or add a crawl rule to crawl this content. (The item was deleted because it was either not found or the crawler was denied access to it.)".


If I check the event viewer, it indicates following error: "Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. [CLIENT: <local machine>]"


My default content access account is another one than this NT AUTHORITY\NETWORK SERVICE account. The content access account password is correct. Apparently this content access account is translated to the NETWORK SERVICE account upon a crawl. And this network service account doesn't has the appropriate rights on database level. How can I fix this?


How to check if a Control partially or completely obscured by other windows

In  http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/78289886-f3c1-405b-aaa1-722a23690245 is described how to test if a Window is obscured by other windows. Is there a way to do this wit a single control ?  Using the  GetOverlappedIntersection from the example dosent work. ? I'am not very good in Win32... but Controls implement IWin32Window also - Wht is the difference to Forms ? Thank you

Change the Default Date in the Date Picker Control

Hi, I have a WPF Datagrid in which one of the columns is a Date Column. So i have used a DataTemplateColumn as Follows     <my:DataGridTemplateColumn CellTemplate="{StaticResource EffDateDateTimePickerControl}"   CellEditingTemplate="{StaticResource addrEffDate}" Header="Effective Date"/> And in my Resource File i have written the following code: Style   TargetType="{x:Type my:Calendar}" x:Key="CalenderControlTemplate">     <Setter Property="Template">     <Setter.Value>     <ControlTemplate TargetType="my:Calendar" >     <my:CalendarItem Name="myCalendarItem"   Background="White"   BorderBrush="Black"   BorderThickness="1"   VerticalAlignment="Center" />     </ControlTemplate>       </Setter.Value>     </Setter>     </Style>       <DataTemplate x:Key="EffDateDateTimePickerControl">     <Label x:Name="lblEffDate" Content="{Binding effectiveDate,Mode=TwoWay}" ></Label>     </DataTemplate>     <DataTemplate x:Ke

How to Set default file name of image in FileUpload Control

helloi want to set  default value in Fileupload control.Because when i select file name using fileupload then save that file to sqlserver database i got problem when no file is select. so i found alternate of that i should store default image into database through fileupload control but now my query is how to set default image to fileupload control.please i want source code.i really need it......tnx in advance

How to make cause validation false for Show Edit buttons in Gridview control

  HI. I am having 2 (dept name, City)dropdownlist, 1 Save button once if we click the save then record will be displayed in grid (Gridview with ShowEditbutton =true and I have Edit logic in my page). But if I click on Edit button then if I try to update the value then it is firing a message "Select dept" because dept dropdown present in the page so I want to make cause validation false for Show Edit buttons (update and cancel). Pleaase tell me Thanks

How do I check if ExecuteScalar() returned me any rows when you are using casting this way...


Hi all

The code below works fine if I have records on my table but if the table is empty I get the following error:

latestTimeStamp1 = (DateTime)cmd.ExecuteScalar(); <=== {"Specified cast is not valid."}

So I am trying to add an IF statement to check if there was any return from ExecuteScalar() method.
How can I verify if something was returned or how can I prevent this cast error from happening?
I managed a workaround by using DataTable and checking if table was null but I need this code to have less overhead as possible since I will be pulling up this timeStamp date all the time.

 DateTime latestTimeStamp1 = DateTime.UtcNow;
 string select = "select max(timeStamp) from Table1";

 SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["Test"].ConnectionString);
		 SqlCommand cmd = new SqlCommand(select, conn);

	//if ExecuteScalar returns something 
	 	latestTimeStamp1 = (DateTime)cmd.ExecuteScalar();
		return latestTimeStamp1;
 catch (Exception ex)

Thank you

How to Check Asp.net Control Is Enabled or Not



I want to check whether a control is enabled or not.

default style for control

Hi all , I have a problem when I use button in some code base , I found some guys already defined lots of style for the button and buttonbase , but I want to use the default style in WPF , can I prevent the button inherit the style from custom , only use the WPF ?

Question about Workflow in Document Library with version control and check-in/out enabled



I use Sharepoint Foundation 2010 and have a workflow to set some metadata in a document with version control and check-in/check-out enabled (approval content is not enabled because anyone in the team can be a possible editor of the document).

My metadata is:

- a generated doc id with text+id (example P&D_1)

- a calculated status based in version: minor version = "on development" and major-version="published/approved"

I defined two workflows:

1) is called when item is created to define id and status.

2) is called when item is updated and status is re-calculated if version is major. (It is called in every item change, not only when user wants to publish a major version, because this option doesn't appear in SPD)

I noticed that sharepoint workflow must do a check-out to be able to update metadata, and because of this the version number is incremented. When version is minor, I don't care, but when version is major I have a problem, because just after publishing the version 1.0, the workflow changes metadata and the version to 1.1. and 1.1 means that the document is not approved anymore...


a) Isn't it possible to do the workflow to check-in and override the last/current version to not generate a new version??

b) Or is it possible to stop versi

Is there any free spell check control for asp.net


wondering whether there is any free spell check control or way to check the spell and give suggestions on test box control?? for asp.net page??

thanks a lot in advance....

Opening links from WPF WebBrowser control in default browser instead of IE

I am working on a WPF application that uses System.Windows.Controls.WebBrowser to display an embedded HTML page.
The problem I have is that all links from that page that are to open an external browser window (with target="_blank") open Internet Explorer instead of the configured default browser.
How do I tell the WebBrowser control to respect the default browser settings?

databound checkbox default check not working


Hi I have a datagrid which is bound to a stored procedure in the code behind. This works fine. But the datagrid contains a checkbox which I need to be default checked. First I didn't bind the checkbox and just used:

<ItemTemplate>         <asp:CheckBox ID="chkSelection" Runat="server" Checked= "true" />       </ItemTemplate>

but they show as unchecked. then bound it using:

        <asp:CheckBox ID="chkSelection" Runat="server" Checked= '<%# Bind("chkSelection") %>' />

  <ItemTemplate>         <asp:CheckBox ID="chkSelection" Runat="server" Checked= '<%# Bind("chkSelection") %>' />    &nb

Default Content Approval Workflow not firing after Check-In from Office 2007


I have created an Approval Workflow for a Document Library and assigned it as the Default Content Approval Workflow (in the UI: Start this workflow to approve publishing a major version of an item).

If, through the SharePoint web interface, I "Check-In" and select a Major Version (e.g. 1.0) or I "Publish a Major Version", this workflow is initiated as one would expect.

However, if through Microsoft Office 2007 (e.g. Word) I Check-In the document as a Major Version (e.g. 1.0) it does NOT initiate the workflow. It DOES set the Document Status to Pending but does NOT initiate the Approval workflow. It then becomes necessary to "Cancel [the] Approval" in the GUI and re-Publish it in order for the workflow to be initiated. This is crazy! Microsoft have achieved fantastic results with their Office integration, why hasn't the initiation of the Default Content Approval Workflow been included?

Can anybody replicate this? What is the correct channel for reporting this to Microsoft? Has anybody else discovered this and found a solution?

I can't believe SharePoint has been used as a Document Management System and nobody else has discovered this flaw?

Report viewer control is is displaying parameter item 'select a value' even when the default param



I am using SSRS 2008 R2,

I have set the default parameter of dropdown and in the output "select a value" item text is removed ,also in the Report Manager 'select a value' removed .

But when I am displaying the same reports in the ReportViewer control as ReportViewer1.ServerReport  in the the vs 2010 asp.net project the item select a value is reappearing in the output.

Could you please help me remove the default item text 'select a value' from the ReportViewer control aswel.


How to set default Image to RichFieldImage control in custom Publishing Page layout in Site defini




How to set  default Image to RichFieldImage control  in custom Publishing Page layout in Site definition?


Override Default MS contextmenu in custom control

I am creating a custom TextBox control with default ContextMenu as below.



<ContextMenu >

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend