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


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

make a control required field using code in infopath

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :SharePoint
 

Hello guys,

How do i make a field required field using code. Specifically, how to make attachment control mandatory.

I know there is an option to select cannot be blank in properties but i want to do it conditionally.

Please help me.

 

 




View Complete Post


More Related Resource Links

how to apply styles on the message displayed by asp.net required field validator control?

  
 Hi,I want to apply styles on the message (i.e. Name field is required) display by the asp.net required field validator control.Styles=border, padding, background-color, font-color, font-weight, img etcAnd I also want highlight the border or asp.net textbox and asp.net dropdown list with which this control is associated.  RequiredFieldValidator does not have style property !Can anyone let me know how can I do this???Regards,Dazy

Here is my new control code i couldnt make it so if i change the control size on form1 designer so i

  

I have two major problems.

1. After dragged the control to form1 designer when im on form1 designer i dont see anything in the control only when i run my program. I thought ill some kind of preview or what i painted in the control ill see it on the form1 designer before i run my application.

2. On form1 when i manualy stretch the size of the new control on form1 designer to be bigger or smaller the things i painted dosent fit i thought the way i created the code in the control code it will keep its size arroding to the size changed ill do in form1 designer but it dosent.

 

So here is the code of the control and form1 can someone help me with this two problems show me the correct code?

 

First the control code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DannyGeneral;

namespace My_Diet_Control
{
   
    public partial class My_Diet_Graph_Control : UserControl
    {
      
        int x_axis_lenght;
        int y_axis_lenght;
   &

Here is my new control code i couldnt make it so if i change the control size on form1 designer so i

  

I have two major problems.

1. After dragged the control to form1 designer when im on form1 designer i dont see anything in the control only when i run my program. I thought ill some kind of preview or what i painted in the control ill see it on the form1 designer before i run my application.

2. On form1 when i manualy stretch the size of the new control on form1 designer to be bigger or smaller the things i painted dosent fit i thought the way i created the code in the control code it will keep its size arroding to the size changed ill do in form1 designer but it dosent.

 

So here is the code of the control and form1 can someone help me with this two problems show me the correct code?

 

First the control code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;<


danieli

Infopath Question: XPath code to remove domain name from AccountID field in Person/Group Picker

  

I have an infopath email based submission form where I am using the Person/Group picker as a way for people to find people in the active directory to CC the form to. I was using the field "DisplayName" in the control and discovered that when you try to CC several employees, that it would disrupt the rules and you can't send the form.

I want to use the field "AccountID" but it includes the domain before the email alias (for ex. REDMOND\johndoe). Is there a formula code I could use to remove the domain from every email alias. Right now my CC formula is concat(SubmitterAlias, "; ", DisplayName)


Bind Infopath 2010 Form Control to another List Field

  

Hi, I am having Sharepoint 2010 RTM Enterprise Trial on Windows Server 2008 SP2.

I have Two Lists (List1 and List2) and List2 has a lookup field for List1 ID.

I want to bind some of the controls on infopath form of List1 to List2 fields such that when the user enters the values, these values would be saved in List2 and when the user want to edit the data of List1, the values can be retrieved from List2 on Form Load.

can it be done ?

can it be possible without having a field in List1 (direct binding to List2 field) ?

thanks.

How to use required field validator along with ajax tool kit editor control?

  

Hi,

How to use required field validator along with ajax toolkit editor control?


Make sure that the class defined in this code file matches the 'inherits' attribute, and that it e

  

Here is the page directive for the page that throws the error:

<%
@ Page language="c#" Inherits="University.AspNet.Index" CodeFile="Index.aspx.cs" %>

The code behind file Index.aspx.cs starts like this:

using University.Framework.UI;

namespace University.AspNet

{
      
public partial class Index : University.Framework.UI.HomePage

The code behind is extending this HomePage class, which is in turn an extenstion of another class University.Framework.UI.Page, which extends the System.Web.UI.Page class.

Am I misusing the I

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)

  

Hey guys


I came across this bug using while trying to implement a sitemap




Line 147:						Panel panel = new Panel();
Line 148:						panel.Controls.Add(_viewState);
Line 149:						Page.Form.Controls.Add(panel);
Line 150:						string script = "document.getElementById('" + _viewState.ClientID + "').value = GetViewState__AspNetTreeView('" + Extender.MakeChildId("UL") + "');";
Line 151:						Page.ClientScript.RegisterOnSubmitStatement(typeof(TreeViewAdapter), _viewState.ClientID, script);


[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
   System.Web.UI.ControlCollection.Add(Control child) +8696951
   CSSFriendly.TreeViewAdapter.SaveAdapterViewState() in E:\wwwroot\ThirdParty\CSSFriendly\CSSFriendly_24242\CSSFriendly\TreeViewAdapter.cs:149
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +8901848
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.

How to install the Css Friendly Control Adapter Source Code

  

Hi guys really new to ASP.NET I was trying to install the CSS Friendly control adapter but for some reason the instructions on the website seems outdated. I downloaded all the files (Source Code, DLL, Browser) I believe I need to add the DLL file to my website's Bin folder and the Browser file to the APP_Browsers folder is this correct? After I place this files how to I get it working? what do I have to do?

Also if I want to create a new DLL file from the Source code how do I do these? I opened the web-site with Visual Studio 2008 and I can see all the files in the solution explorer? But how do I compile this to a DLL file? I tried doing a build solution but all I get is an .sln file???

Any help would be greatly appreciated


Thanks in advance

Carlos


.NET Code Tuning: Make Your Apps Fly with the New Enterprise Performance Tool

  

Because the common language runtime (CLR) is a black box, it's pretty hard to divine what's going on when you want to track down performance problems. Microsoft will be delivering a brand new profiler, the Enterprise Performance Tool (EPT), as part of Visual Studio 2005 Team Developer Edition that's ideal for use on a production system because it offers some very lightweight means of collecting performance data. Here John Robbins takes you on a tour.

John Robbins

MSDN Magazine December 2004


Debugging: DataTips, Visualizers and Viewers Make Debugging .NET Code a Breeze

  

There is a whole host of new goodies in upcoming release of Visual Studio 2005 that will enhance your debugging experience. One such improvement will make it easy to visualize types within the debugger. This article discusses those improvements and covers debugger attributes and type visualizers. In addition, the author shows you how to extend the display of your own types with custom attributes and how to plug in an assembly to visualize.NET types built into the framework.

Morgan Skinner

MSDN Magazine May 2004


Virtual Source Code Control Systems: Promoting and Managing Projects using Visual SourceSafe

  

Source code control systems like Microsoft Visual SourceSafe can simplify just about any development project, and make it easier for your code to move safely among individual programmers, development teams, and project stages. Visual SourceSafe provides an object model that you can use as the basis of your own customized source code control environment. To give you an idea of what is possible, we'll walk you through the elements of a browser-based source code control system built with Visual SourceSafe, ASP, and VBScript. This simple system lets members of your team build, label, and promote individual files or entire projects, and to reverse promotions.

Ken Ramirez

MSDN Magazine May 2000


How to make expanding/collapsing CollapsiblePanelExtender from code behind smooth and animated

  

I've got a CollapsiblePanelExtender in place on a panel in test and it works like a champ. (I get excited about the simplest things).  When I click the panel header it expands and collapses with smooth animation, as expected and desired.

But when I change its state via code behind, it seems I am merely changing its state and somehow bypassing the javascript that controls the smooth animation.

My markup is out of the box. I have added code behind and some javascript, but I am missing the connection.  Here is the javascript:

function pageLoad(sender, args)
{
    smoothAnimation();
}

function smoothAnimation()
{
    var collPanel = $find("CollapsiblePanelExtender1");
    collPanel._animation._fps = 45;
    collPanel._animation._duration = 0.50;
}

 

And here is the code behind:

protected void btnExpand_Click(object sender, EventArgs e)
{
    this.CollapsiblePanelExtender1.Collapsed = false;
    this.CollapsiblePanelExtender1.ClientState = "false";
}
 

protected void btnCollapse_Click(object sender, EventArgs e)
{
    this.CollapsiblePanelExtender1.Collapsed = true;
   

Use DB query result to generate Jquery required lines of code

  

Hello

I 'm gonna query database for photo records. each record include "photo path" where imagesURL  stored in string format

 I Choses my favorite Juqery plugin to show images. Plugin needs some lines of code like below.

How could I  generate these lines

<script>
$(function() {
$('#slideshow').crossSlide({
sleep: 2,
fade: 1
}, [
{ src: 'picture1.jpg' },
{ src: 'picture2.jpg' },
......
.....
{ src: 'picture4.jpg' }
])
});
</script>

how to add vailidation between library field and infopath

  

 i have a browser enable form with filed mails ids and cost i am promoting these filed, and it's saving in library  but i need a vailidation when if any when to submit  requets using mail and cost , at  time i need availidation that your mail id is already  exit , i create a receiving connection for mail id fields it received fileds how to i compare it

thanks


Infopath form return XMl code during workflow task

  

1.     Review 7777.xml.

2.     Perform the specific activities required for this task.

Use the Edit this task button to mark the task as completed. (If you cannot update this task, you might not have access to it. Click here to request access.

Extracting Infopath form templates (with code behind) from a farm

  

Hi,

I am in the middle of a migration of MOSS 2007 on server 2003 R2 to server 2008 r2, to be in the position to migrate to SP 2010. I am trying to extract form templates (with code-behind) from the old farm to the new farm. I did not set this farm up myself, so I would have copies of everything that was deployed to the farm, but now I don't. I have tried grabbing the .xsn from the Form Templates form library, and the form comes over, but no code behind, it says, The VB or C# project for this form template cannot be found. I have also tried extracting the solution files, and changing the file ext to .cab and opening the file up, only to find nothing very useful.

I need to extract and open the code up because I believe one of the forms that sends emails dynamically, is pointing to an old exchange server, because the emails are not getting through, and the exchange server was recently changed.

Any ideas would be much appreciated.

 


Categories: 
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