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

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

C++ at Work: Enum Declarations, Template Function Specialization

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

More Related Resource Links

Pure C++: Generic Programming: Template Specialization


As I discussed in my last column, a param-eterized type that does more than simple storage and retrieval is constrained as to the acceptable types that may be safely bound to it (see Pure C++: CLR Generics Versus C++ Templates.

Stanley B. Lippman

MSDN Magazine August 2005

Why sum function work fine in infopath and not in web browser

Hi,   I used the sum function in infopath, it work fine in infopath client, but the same open in web browser it not working correctly, it show the double the value. why it happen?

WSS 3.0 Knowledge Base Template doesn't function properly after SharePoint 2010 migration

I migrated our WSS 3.0 instance to SharePoint 2010 in a dev environment.  So far, everything works with the exception of the most heavily utilized portion of our WSS 3.0 installation – which is a "Knowledge Base" sub-site utilizing the following features:   Knowledge Base List Instances: List Instances for the Knowledge Base Application Template Knowledge Base Modules: Modules for the Knowledge Base Application Template Knowledge Base Provisioning Handler   Link to Knowledge Base Template http://www.microsoft.com/downloads/details.aspx?FamilyId=BC4E5C4E-FBBB-4666-8E32-C4CEE09E1FE6&displaylang=en   Two issues exist with the Knowledge Base after migrating.   1.       The “Write new Article” feature which uses a content type called “Wiki Knowledge Base Article” use to open a “New Wiki Page” that provided the all of the associated fields specified in the List Content type settings.  Upon creating the new Wiki Page (i.e. Knowledge base article) it would associate it with the “Knowledge Base” document library.  The “Write new Article” feature now fails to utilize / recognize the Content Type settings and instead create a blank New Page without any fields except for “New page name:” and also creates a “Site Pages&

The Group Work Site template has the "What's New" web part on it's home page and I have the follow


I can't find that web part as something I can use elsewhere? As in, I can't add that web part on other pages made even on the same site. What would be ideal is to have that web part available to add as needed to other sites/pages of course. As it stands, for me it seems the only place I can use that web part is on the home page of a new "Group Work Site", i hope that I'm wrong. I've tried exporting the web part, but the importing does nothing when trying to import it to other sites, of course other 2010 sites. Please let me know how I may add that web part to my available to use web parts please.



How can I adapt the Javascript function below to work with my TextBoxes?


Hi all,

How can I adapt the Javascript function below to work with my TextBoxes?

<head id="Head1" runat="server">   
    <title>Untitled Page</title>   
    <script type="text/javascript">   
        function f(ta_id)   
            var d=document, ta, rng;   
                if(ta && ta.createTextRange)   
                 <asp:TemplateField HeaderText="Comments" SortExpression="Comments">
                      <asp:TextBox ID="txtBoxComments" runat="server" Width="800px" MaxLength="1000" ReadOnly="true" Rows="1" Text='<%# Eval("Comments") %>'
                       TextMode="MultiLine" Wrap="true" onscroll="f('txtBoxComments')" />

When I look at the "View Source" I

WPF Custom Control template doesn't work



I've created a WPF custom control that goes in a DLL and I'm trying to use the control in another project.  Everything works fine except for the part of getting the control template to work. I should get an Orange background as defined below but the control just shows empty in the XAML editor and in runtime.

The code is as follows:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace MyCustomControl
    public class CustomCtrl : System.Windows.Controls.Control
        public static readonly System.Windows.DependencyProperty ValueProperty;
        public string Value
            get { return (string)GetValue(CustomCtrl.ValueProperty); }
            set { SetValue(CustomCtrl.ValueProperty, value); }

        static CustomCtrl()

Sorting function does not work fine -- Please help



          We have few SSRS 2008 reports.Some of the reports are plain simple table reports and few reports are grouped reports ( table reports). The issue is, sorting function works fine in simple reports whereas its not working good in the reports where grouping is involved. Could you please help me to resolve it?

Function not working in IE but work in all other browsers



I tested a JQuery function to create a Facebook like progress image. It works like a charm in all browsers (Chrome, Safari, Firefox, Opera) except IE8.

Any idea why?


    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('a').click(function (e) {
                var el = '';
                switch (e.target.text) {
                    case "Box 1":
                        el = '#box1';

WPF ComboBox Style/Template example from MSDN doesnt work if "IsEnabled"=false?



I am using a customized look of the WPF combobox control with the help of the msdn Style and Combox Template example taken from here: http://msdn.microsoft.com/en-us/library/ms752094.aspx

I copied that code and I can use the control just fine, but as soon as you set the combobox attribute "IsEnabled" to false, you always get an error warning in Visual Studio 2010 Designer view with the following message:

'System.Windows.Media.Animation.ColorAnimationUsingKeyFrames' animation object cannot be used to animate property 'Foreground' because it is of incompatible type 'System.Windows.Media.Brush'.

Actually I have no idea on how to fix this error. Does anyone have an idea what is causing this error? Since its an msdn example everyone should encounter this error when disabling the control with this template example?

Thanks in advance for your help, kind regards,

How to: Change control template using a enum and triggers...?


Hey I have a window with a Control, pretty simple.. It's like this:

<ResourceDictionary Source ="/Xaml/TraceView.xaml"/>
<Control c/>



now the control still needs to be set to an existing ControlTemplate, but I want it to set to a controltemplate based on the value of a enumaration in my code behind... How to I go about this? I want to do something like:

<Control c>

<DataTrigger Property = *TheEnum* Value= eg. Startup>
<Setter Property = Template Value={StaticResource ResourceKey="StartupView"}/>



please help me

Making a link work in a JS function



I'm new to jQuery, but learning fast, and loving the new functionality!
I'm using a Flash upload component that all works fine, and once it's complete (file uploaded) it calls the following function:
function EAFlashUpload_onResizedImagesUploadEnd() {

How to jquery get function work in different folder page i mean.....


this is work

$.get("QC_GridView.aspx",{ QcSearch: "" + "All" + "" },
                        function(data) {

but this is not work   how to run below code

$.get("UserControl/QC_GridView.aspx",{ QcSearch: "" + "All" + "" },
                        function(data) {

Cannot make filter function work the way I want it to on a drop down box

Building a template based on a database in order to submit data to the database. Key components are a separate Materials database qry providing material name and type and then the process data that will feed into the main connection the "process database".  On the Process form, I'm trying to understand how to set up a filter that when the material name is selected from the drop down box that pulls from the materials qry, then the material type automatically populates in a separate ???? type box??  I need the Material type to match the material name (one to one).  I'm just not too sure about filters???

Call Function return as Enum on the WCF


Hi all,

i am having problem on the WCF function return with Enum


For example as below:

<OperationContract()> _

Function CanLoadPage(ByRef DynRec as Datatable,Byval Transstring as string) as resultstatus

resultstatus actually is public enum.


How can i pass this enum back to client?





Bryan Tan

RadioButton inside GridView, How to get it work as normal

Did you tried before to drag a RadioButton control inside a Gridivew templatefield, and then you attempt to select these RadioButtons , you will notice that the behavior of RadioButton control will be changed and it will work just like the behavior of checkbox control! the user will be able to select more than one radiobutton in the grid!

Compiler-generated scopes for local variable declarations

I was tasked with understanding and fixing a bug on error reporting with foreach iteration variables the other day, and it got me thinking about local variable scoping rules in C# in general. First, the bug.

Dropdown Event (Template Field)



I have grid view control that includes a dropdown control in a template field.

I wish to execute some code when the value is changed in the dropdown list.  Can't figure out how to capture this event though?

Any suggestions?

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