Re: ASP.NET Help

Dan - I'm a bit confused by your example, maybe because I'm not completely familiar with the declarative databinding in ASP.NET 2.0.  Are you having a problem with the ASP or with the SQL or both?  If it is both, let's start with the SQL.

What do you mean by:

Dan wrote:

..."Where" clause and it seems only to work for 1 and only 1 entry - in this case [SU].  I then tried giving each day its own checkboxlist and I get similar results.  To summarize, this method only seems to work for the first value and only the first value.

Can you expand on that a little?

Another question for you, are your checkboxlists autopostback property set to true?  If they aren't, then the postback will not fire and the other lists won't be filtered. 

As to the And/Or unexpected results, have you considered combining your day columns into one and using an integer value 0 to 6 to represent the day that the meeting is on?  That way when your user selects Tuesday a 2 is sent to your where clause and would filter out all of the other rows.

Re: ASP.NET Help

Hi Chuck,
Sorry it look so long for me to get back
to you:

I think the problem I'm having is that although the checkboxes are set to SUCheckbox.checked=false they are returning a value back to the
page of "0"  This value of 0 is then displaying all the meetings NOT on"SU" or NOT on "M" or NOT on "TU" because the database is returning the "0" value

My goal would be to have these checkboxes unbound or set to a value of NOTHING so that when they are unchecked, the page is blank

The reason I stated earlier that the "WHERE" clause only seems to work for 1 checkbox is because when I have more than 1 checkbox, and 1 checkbox has a value of "checked ("1") and the others have a value of unchecked (0), I'm getting mixed results on the page

Am I making sense.  It seems like a value of 0 would disable the checkbox from displaying on the page at all.  Please see the code below and
note: I"m not a programmer, this has all been done in Visual Web Developer's IDE.

Thanks Chuck!

Yes, I'm a bit frustrated.  

"Default=0" value in the control parameter(s) at the bottom with the same result.

Like I stated earlier, but is happening is that the gridview1 is returning the 0 values to the controls - that is, every meeting where "SU", "M", "TU" = 0 is being returned to the page.  How can I "UNBIND" these controls until they're checked.

In Gratitude,

Dan Acton

I've simplified this and just placed on a page by itself a gridview, and 3 checkboxes as follows:


Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> 

html xmlns="" > 

head runat="server"> 

<title>Untitled Page</title> 



<form id="form1" runat="server"> 




<td style="width: 100px"> 

<asp:CheckBox ID="SUCheckBox" runat="server" AutoPostBack="TRUE" /> 

<asp:CheckBox ID="MCheckBox" runat="server" AutoPostBack="TRUE" /> 

<asp:CheckBox ID="TUCheckBox" runat="server" AutoPostBack="TRUE" /></td> 

<td style="width: 100px"> 


<td style="width: 100px"> 





<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="DIR_ID" 

DataSourceID="SqlDataSource1" Font-Names="Verdana" Font-Size="9pt" Style="z-index: 100; 
left: 8px; position: absolute; top: 204px">


<asp:BoundField DataField="DIR_ID" HeaderText="DIR_ID" InsertVisible="False" ReadOnly="True" 

SortExpression="DIR_ID" /> 

<asp:BoundField DataField="CITY" HeaderText="CITY" SortExpression="CITY" /> 

<asp:BoundField DataField="NAME" HeaderText="NAME" SortExpression="NAME" /> 

<asp:BoundField DataField="ADDRESS" HeaderText="ADDRESS" SortExpression="ADDRESS" /> 

<asp:BoundField DataField="COUNTY" HeaderText="COUNTY" SortExpression="COUNTY" /> 

<asp:BoundField DataField="DISTRICT" HeaderText="DISTRICT" SortExpression="DISTRICT" /> 

<asp:BoundField DataField="STATE" HeaderText="STATE" SortExpression="STATE" /> 

<asp:BoundField DataField="ZIP" HeaderText="ZIP" SortExpression="ZIP" /> 

<asp:CheckBoxField DataField="CLOSED" HeaderText="CLOSED" SortExpression="CLOSED" /> 

<asp:BoundField DataField="MTG_CODE" HeaderText="MTG_CODE" SortExpression="MTG_CODE" /> 

<asp:BoundField DataField="TIME" HeaderText="TIME" SortExpression="TIME" /> 

<asp:BoundField DataField="RM" HeaderText="RM" SortExpression="RM" /> 

<asp:CheckBoxField DataField="SU" HeaderText="SU" SortExpression="SU" /> 

<asp:CheckBoxField DataField="M" HeaderText="M" SortExpression="M" /> 

<asp:CheckBoxField DataField="TU" HeaderText="TU" SortExpression="TU" /> 

<asp:CheckBoxField DataField="W" HeaderText="W" SortExpression="W" /> 

<asp:CheckBoxField DataField="TH" HeaderText="TH" SortExpression="TH" /> 

<asp:CheckBoxField DataField="F" HeaderText="F" SortExpression="F" /> 

<asp:CheckBoxField DataField="SA" HeaderText="SA" SortExpression="SA" /> 



<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DATA_1_11_07ConnectionString %>" 

SelectCommand="SELECT [DIR_ID], [CITY], [NAME], [ADDRESS], [COUNTY], [DISTRICT], [STATE], [ZIP], [CLOSED], [MTG_CODE], [TIME], [RM], [SU], [M], [TU], [W], [TH], [F], [SA] FROM [DIRECTORY] WHERE (([SU] = @SU) OR ([M] = @M) OR ([TU] = @TU))"> 


<asp:ControlParameter ControlID="SUCheckBox" Name="SU" PropertyName="Checked" Type="Boolean" DefaultValue=0 /> 

<asp:ControlParameter ControlID="MCheckBox" Name="M" PropertyName="Checked" Type="Boolean" DefaultValue=0/> 

<asp:ControlParameter ControlID="TUCheckBox" Name="TU" PropertyName="Checked" Type="Boolean" DefaultValue=0 /> 






Re: ASP.NET Help

A checkbox server control is always going to return a value since it is a boolean type.  If it is not explicitly set to true it will always return false.  Depending on the datatype you are using (integer for example) 0 is going to show as a true on the checkbox because it has a value.  If the datatype (in the db is bit) the checkbox should display properly.  Depending on your situation, you probably won't be able to use the default data adapter settings and you may need to write some server side code (or in a stored procedure) to handle the type conversion.  I NEVER use the built in wizards for data access (mostly because we use the enterprise library data layer. 

The checkbox is always going to show if you don't toggle the visablity property or the enabled property (greyed out when false).  You will need do some databinding (possibly in the itemdatabound event of the grid) to toggle one or both of those properties.

Last edited by chuck.boyer (2007-01-11 08:49:51)

Re: ASP.NET Help

Can you point me in the right direction on how this might be accomplished?

Re: ASP.NET Help

Sorry, after posting previously I realized I didn't answer your question properly.  Please re-read and let me know if you have questions. 

My recommendation would be the grid tutorials on or better yet,  Scott Mitchell has a whole series on the datagrid.

Re: ASP.NET Help

Hey everyone,

I just found this site, very cool. I like the idea of helping other Christian devs... I am a regular at the forums offering advice, so if anyone has any questions about ASP.NET I would be happy to take a crack at answering them.

-Aaron - Cutting Edge Church Management Software

Re: ASP.NET Help

I'm using the asp.net1.1 System.Web.Mail classes to email users.
The problem is that when I send to an Yahoo recipient, my email goes
straight into the bulk folder.
Is there a way to make sure that my email will go to the recipient's

Re: ASP.NET Help

whodurun4 wrote:

2.  Never read Microsoft's official documentation - it makes you go blind

So True!

† Taj