.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

Why my checkbox override does not work ? ( code attached )

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :WPF

I try to create 3 state button. This control will will change the image on each of those 3 state ( normal, pressed, mouseOver ). The images of each state will be define as a property from the c# code ==> that mean i will be able to re-use this code and change the properties of the image source.


<CheckBox x:Class="StateButton.StateCheckBox" 

View Complete Post

More Related Resource Links

C++ at Work: Managed Code in Visual Studio 2005


Many of you are no doubt in the process of upgrading to Visual Studio® 2005, so I thought now would be a good time to relate some of my own experiences with the new compiler. What took me so long? Hey, I'm a retro kind of guy! Better late than never!.

Paul DiLascia

MSDN Magazine June 2006

How to get Click event to work with checkbox


I am new to ASP.Net and I'm having trouble figuring out what needs to be where in my code.  I have a webform with 2 listboxes and 2 checkboxes... When I check checkbox1 I want listbox1 to be disabled and checkbox2 to be disabled.  Similarly, when I check checkbox2 I want listbox2 to be disabled and checkbox1 to be disabled.  The code does not show any errors; however, when I run the Page everything appears as it is supposed to but when I check the boxes, nothing happens.  What am I missing that will link the code on the .aspx.vb page to the objects on the .aspx page and make them work together?

Here is my code for Page1.aspx.vb:

Public Class LCPage1
    Inherits System.Web.UI.Page

    Protected Sub AllClients_Click(ByVal sender As ObjectByVal e 

Sharepoint: In Calculated Column, Code with multiple "IF" condition does not work.

Implemantation:  Calculate expected resolve date exclude "Saturday" and "Sunday"  based on Priority and Severity.Columns are:1. Priority:2. Severity:3. Raised on: Date record createdCode: Below is the code which contains multiple "If" conditions. For quick undersatnding, i separated major If condition. Below code does not work and sharepoint gives me Sytax error message. =IF(OR(Priority="Critical",Severity="Critical"),IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+3,[Raised on]+1),     IF(OR(Priority="HIGH",Severity="HIGH"), IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+4, IF(TEXT(WEEKDAY([Raised on]+2),"dddd")="Saturday",[Raised on]+4,[Raised on]+2)) ,   IF(OR(Priority="MEDIUM",Severity="MEDIUM"), IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+5, IF(TEXT(WEEKDAY([Raised on]+2),"dddd")="Saturday",[Raised on]+5, IF(TEXT(WEEKDAY([Raised on]+3),"dddd")="Saturday",[Raised on]+5,[Raised on]+3)) ) ,   IF(OR(Priority="LOW",Severity="LOW"), IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+6, IF(TEXT(WEEKDAY([Raised on]+2),"dddd")="Saturday",[Raised on]+6, IF(TEXT

Radio button and Checkbox don't work in Opera

I have a webform with 2 radio buttons and 1 checkbox. These work in IE and FireFox, but theye never get checked in Opera. Is this some problem with Opera or with my checbox/radio button?ThanksI have the following code:<asp:CheckBox ID="ckTermsNConditions" runat="server" Checked="false" /><asp:RadioButtonList ID="rblRegistrationType" runat="server" CellPadding="2" CellSpacing="2"  >                        <asp:ListItem Value="Vendor" Selected="False">How to</asp:ListItem>                        <asp:ListItem Value="Consultant" Selected="False">Feedback</asp:ListItem>                        <asp:ListItem Value="User" Selected="False">Question</asp:ListItem></asp:RadioButtonList>

Looking for .net people in the USA to talk to on Live Messenger during work hours... talk code.. ide

Im not sure this is the right place to ask but ill give it a try. If theres a better place for this someone let me know please anyways. I am a .NET dev and would love to have a couple people int/adv level .net devs I could IM a question regarding .NET things I am working on.. not 'do this for me please!' questions but Id want to ask more general ways to go about doing things and just conversation fun talk about coding ideas .. I am the only dev at work so it is lonely not having anyone I can ask questions to.. so if anyone would like to chat add me on Live messenger (punkouter@hotmail.com)

Why is the code not work?

Hi to all. Why is the code not work? In this code I take the Value (object from class) and transfer it to Store Procedure but before I check if the ClientData.CompanyCode == null  transfer to SP null else transfer the value in the  "CompanyCode" cmd.Parameters.Add( new SqlParameter("@Corporation_code", ClientData.CompanyCode == null ? DBNull.Value : ClientData.CompanyCode)); there is not my code than I don't very well understand this code. Get this error : Type of conditional expression cannot be determined because there is no implicit conversion between 'System.DBNull' and 'string'

How can I make this code work?


I have this code it is work almost correctly but now this code populated data to ALL comboboxes at the time(in the start of UI) the User open the UI.

I need to split the code so when the User select value in combobox corporationCode1 I will advance to combobox WorkSpaceCorporation

for some like this if user select something in combobox CorporationCode1 so advence to combobox WorkSpaceCode..

There is a code/

private void Window_Loaded(object sender, RoutedEventArgs e)



Document attached to Infopath; will it work offline?


We have a user that has created an editing template using infopath. Part of the process involves uploading documents to the form template. It is part of an editing process they've created. The question is since the document is attached to the form what happens when SharePoint goes offline? I know you can sync the form to Outlook but if you work offline and then sync it back to SharePoint, will the changes you made to the document be recorded or just to the form itself? I hope I've explained this clearly.


I should mention were using MOSS 3.0 SharePoint 2007 server.

Gridview row sometimes has to be selected twice for code to work


I'm using the code below to extract data from a gridview and populate it into textboxes for the days and two drop downs for Project and Category.

For some rows in the gridview everything but the category ddl populates correctly. If I click the row a second time the category ddl displays the correct category.

Can anyone tell me why I have to click twice for some rows? And how do I fix this?

Thank you

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    //// Get the currently selected row using the SelectedRow property.
    GridViewRow row = GridView1.SelectedRow;

    txtSunday.Text = (row.Cells[6].Controls[0] as DataBoundLiteralControl).Text.Trim();
    txtMonday.Text = (row.Cells[7].Controls[0] as DataBoundLiteralControl).Text.Trim();
    txtTuesday.Text = (row.Cells[8].Controls[0] as DataBoundLiteralControl).Text.Trim();
    txtWednesday.Text = (row.Cells[9].Controls[0] as DataBoundLiteralControl).Text.Trim();
    txtThursday.Text = (row.Cells[10].Controls[0] as DataBoundLiteralControl).Text.Trim();
    txtFriday.Text = (row.Cells[11].Controls[0] as DataBoundLiteralControl).Text.Trim();
    txtSaturday.Text = (row.Cells[12].Controls[0] as DataBoundLiteralControl).Text.Trim();

    // Set ProjectList ddl to Project in selected row
    if (ProjectList.Items.FindByText

Simple C# code does not work


Hi everyone,

How can I put the C# code into the htm file ? Then following
code does not work. How can I make it work ?



-------------- begin RSSTable.htm ---------------

ProductId = <%= Request.Params.Get("ProductId") %>

-------------- end RSSTable.htm ----------------

Very Simple JQuery code does not work


Hi everyone,

How come the following code does not work ?  If you can, please make the following code to work for me.



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CookiePage1.aspx.cs" Inherits="CookiePage1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

    <script type="text/javascript">

        function SetCookie(T) {

            //Create (or update) the value of a cookie to expire in 2 days:
            $.cookie('ShoppingCartId', T, { expires: 2 });


        function ReadCookie() {
            var SCId = $.cookie('ShoppingCartId');

            return SCId;


        $(document).ready(function () {
            var T = "Testing Cookie";




    <form id="form1" runat="server">
    <div class="MyShoppingCartId">       

ValidateInput doesn't work on FF and Chrome, while executing from "override void OnActionExecuting"


before I would start

I had added


on my methods


<httpRuntime requestValidationMode="2.0"/> to web.config

also added to the view ValidateRequest="false" to be sure

still the same

I am running the code from override OnActionExecuting as I got some classes which need to run on each action start

it seems to work fine on IE but fails on FF and Chrome

"Place code in separate file checkbox" is not showing up



I have a strange problem.

When I create a new webform in my projects I cant see the checkbox "Place code in separate file".

Instead VS2008 automatically creates a webform and a codebehind file.

I used to be able too see the checkbox, but one week ago or so, it just disappeared.

I want to be able to use inline code in my projects. Anyone have a clue what the problem might be?

Code that works in WebDAV does not work when deployed to IIS7



I have been working on a solution that:

1. Connects to a Lotus Domino server to retrieve data from the .nsf file

2. Uses NotesSQL Driver 8.0 (I've tried both System DSN and ConnectionString method)

3. When I view the page using VS 2008 own's WebDAV to test run, it works flawlessly.  Database can be connected and so Data was retrieved successfully. 

However, when I deployed the website to IIS 7, it gives me problem:

Following is the stacktrace from the Event Viewer entry:

Log Name:   Application
Source:    ASP.NET 2.0.50727.0
Date:     02/11/2010 5:04:07 PM
Event ID:   1309
Task Category: Web Event
Level:     Warning
Keywords:   Classic
User:     N/A
Computer:   KITWILLIAM.naim.com
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 02/11/2010 5:04:07 PM
Event time (UTC): 02/11/2010 9:04:07 AM
Event ID: 0ec2d703a5884f92be87faf06f746c00
Event sequence: 4
Event occurrence: 1
Event detail code: 0
Application information:
  Application domain: /LM/W3SVC/1/ROOT/Resrc-4-129331622441589373
  Trust level: Full
  Application Virtual Path: /Resrc
  Application Path: C:\inetpub\wwwroot\Resrc\
  Machine name: KITWILLIAM
Process information:
  Process ID: 2644
  Process name: w3wp.exe
  Account name: NT AUT

Convert code for GridView to work in DetailsView


Can anyone help me out please ?  I want this code to work in a DetailsView -

protected void gvContacts_RowDataBound(object sender, GridViewRowEventArgs e)
        if (e.Row.RowType.Equals(DataControlRowType.DataRow))
            DropDownList ddlGroupName = (DropDownList)e.Row.FindControl("ddlGroupName");
            Label lblGroupName = (Label)e.Row.FindControl("lblGroupName");
            lblGroupName.Text = ddlGroupName.SelectedItem.Text;
            ddlGroupName.Visible = false;

Thank you in advance

[Q] WF4 Getting Started Tutorial doesn't have code attached


So I'm trying to go through the getting started tutorial, but even on the the first step of "Create An Activity"


I don't see any code for the ReadInt activity. Which I think contains something to read input from something? I thought it was because of the new views but I tried both classic and scriptfree mode and still nothing.

Can anyone point me to a completed sample? Or point me to where the code is? Thanks.

Code working in XP / 32 bit won't work in Win 7 / 64 bit - "Input string was not in a correct forma


I'm working on a program in VS 2008 / XP 32 bit. So far everything has been working
fine in both XP 32 bit and Win 7 / 64 bit - until I introduced the following piece of

        private void DateFilter()
            // strDate = "MM/dd/yyyy";

            // convert strDate to yyyyMMdd
            strConvYear = strDate.Substring(6, 4);
            strConvMonth = strDate.Substring(0, 2);
            strConvDay = strDate.Substring(3, 2);
            strConvDate = convYear + convMonth + convDay; // yyyyMMdd
            intConvDate = Convert.ToInt32(strConvDate);

            // convert DateTimePicker (dtpSortDates) format yyyy-MM-dd to yyyyMMdd
            intDtpSortDates =

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