I'm getting a "Specified cast is not valid" error related to a checkbox on my Advanced Edit form in Scheduler.
The database field is a bit type.
Here is the code...
ASPX:
|
<table cellpadding="0" cellspacing="0" border="0"> |
|
<tr> |
|
<td><b>Title</b></td> |
|
<td> </td> |
|
</tr> |
|
<tr> |
|
<td><asp:TextBox runat="server" ID="EventTitleTemp" Text='<%# Eval("EventTitle") %>' Width="240px"></asp:TextBox></td> |
|
<td><div style="margin-bottom:3px;"><asp:CheckBox runat="server" ID="EventActiveTemp" Checked='<%# Convert.ToBoolean(Eval("EventActive")) %>' style="padding: 0em; margin: 0em; vertical-align: middle;"></asp:CheckBox> Active</div></td> |
|
</tr> |
|
</table> |
Code Behind:
|
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] |
|
public bool EventActive |
|
{ |
|
get |
|
{ |
|
return EventActiveTemp.Checked; |
|
} |
|
|
|
set |
|
{ |
|
EventActiveTemp.Checked = value; |
|
} |
|
} |
Am I missing something? Doing this totally wrong? Any help would be appreciated.
| <telerik:RadComboBox ID="rcbSalesPersons" DataSourceID="odsSalesPerson" runat="server" |
| Filter="Contains" DataTextField="Description" DataValueField="ValueID" |
| SelectedValue='<%# Bind("SalesPersonID") %>' EmptyMessage="Select a Sales Person..."> |
| </telerik:RadComboBox> |
trvwNewTree.Nodes.Add(rootNode);
//rootNode.ExpandChildNodes();
rootNode.Expanded = true;
I also used the note code, but i fonded is not useful.
other:
I found the + is to - while using exmaple front code.
After loading the rootNode,the child is empty. I want to use the " rootNode.Expanded = true;" to fire the NodeExpand event, In this event is the code to load the child node.
thank you
| <?xml version="1.0"?> | |
| <configuration> | |
| <configSections> | |
| <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> | |
| <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> | |
| <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/> | |
| <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> | |
| <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" /> | |
| <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /> | |
| <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /> | |
| </sectionGroup> | |
| </sectionGroup> | |
| </sectionGroup> | |
| </configSections> | |
| <appSettings> | |
| </appSettings> | |
| <connectionStrings> | |
| </connectionStrings> | |
| <system.web> | |
| <httpHandlers> | |
| <remove verb="*" path="*.asmx"/> | |
| <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> | |
| <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> | |
| <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/> | |
| <add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> | |
| <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false" /> | |
| </httpHandlers> | |
| <httpRuntime executionTimeout="1000" maxRequestLength="102400" requestLengthDiskThreshold="8192"/> | |
| <!-- Set compilation debug="true" to insert debugging | |
| symbols into the compiled page. Because this | |
| affects performance, set this value to true only | |
| during development. | |
| --> | |
| <compilation debug="true"> | |
| <assemblies> | |
| <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> | |
| </assemblies> | |
| </compilation> | |
| <authentication mode="Forms"> | |
| <forms loginUrl="~/Login.aspx" protection="All" defaultUrl="~/Default.aspx" timeout="1440"/> | |
| </authentication> | |
| <authorization> | |
| <deny users="?"/> | |
| </authorization> | |
| <membership defaultProvider="SecurityMembershipProvider"> | |
| <providers> | |
| </providers> | |
| </membership> | |
| <pages> | |
| <controls> | |
| <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> | |
| <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> | |
| </controls> | |
| </pages> | |
| <httpModules> | |
| <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> | |
| </httpModules> | |
| </system.web> | |
| <location path="register.aspx"> | |
| <system.web> | |
| <authorization> | |
| <allow users ="*" /> | |
| </authorization> | |
| </system.web> | |
| </location> | |
| <location path="terms.aspx"> | |
| <system.web> | |
| <authorization> | |
| <allow users ="*" /> | |
| </authorization> | |
| </system.web> | |
| </location> | |
| <location path="Telerik.Web.UI.WebResource.axd"> | |
| <system.web> | |
| <authorization> | |
| <allow users="*"/> | |
| </authorization> | |
| </system.web> | |
| </location> | |
| <system.codedom> | |
| <compilers> | |
| <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4"> | |
| <providerOption name="CompilerVersion" value="v3.5"/> | |
| <providerOption name="WarnAsError" value="false"/> | |
| </compiler> | |
| <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4"> | |
| <providerOption name="CompilerVersion" value="v3.5"/> | |
| <providerOption name="OptionInfer" value="true"/> | |
| <providerOption name="WarnAsError" value="false"/> | |
| </compiler> | |
| </compilers> | |
| </system.codedom> | |
| <system.web.extensions> | |
| <scripting> | |
| <webServices> | |
| <!-- Uncomment this line to customize maxJsonLength and add a | |
| custom converter --> | |
| <!-- | |
| <jsonSerialization maxJsonLength="500"> | |
| <converters> | |
| <add name="ConvertMe" | |
| type="Acme.SubAcme.ConvertMeTypeConverter"/> | |
| </converters> | |
| </jsonSerialization> | |
| --> | |
| <!-- Uncomment this line to enable the authentication service. | |
| Include requireSSL="true" if appropriate. --> | |
| <!-- | |
| <authenticationService enabled="true" requireSSL = "true|false"/> | |
| --> | |
| <!-- Uncomment these lines to enable the profile service. To | |
| allow profile properties to be retrieved | |
| and modified in ASP.NET AJAX applications, you need to add | |
| each property name to the readAccessProperties and | |
| writeAccessProperties attributes. --> | |
| <!-- | |
| <profileService enabled="true" | |
| readAccessProperties="propertyname1,propertyname2" | |
| writeAccessProperties="propertyname1,propertyname2" /> | |
| --> | |
| </webServices> | |
| <!-- | |
| <scriptResourceHandler enableCompression="true" | |
| enableCaching="true" /> | |
| --> | |
| </scripting> | |
| </system.web.extensions> | |
| <system.webServer> | |
| <validation validateIntegratedModeConfiguration="false"/> | |
| <modules> | |
| <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> | |
| </modules> | |
| <handlers> | |
| <remove name="WebServiceHandlerFactory-Integrated"/> | |
| <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> | |
| <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> | |
| <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> | |
| <add name="Telerik.Web.UI.WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" /> | |
| </handlers> | |
| </system.webServer> | |
| <!--<runtime> | |
| <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | |
| <dependentAssembly> | |
| <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/> | |
| <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> | |
| </dependentAssembly> | |
| <dependentAssembly> | |
| <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/> | |
| <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> | |
| </dependentAssembly> | |
| </assemblyBinding> | |
| </runtime>--> | |
| </configuration> | |
| <%@ Master Language="C#" AutoEventWireup="true" Inherits="TriMain" | |
| CodeBehind="TriMain.master.cs" %> | |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> | |
| <!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 id="Head1" runat="server"> | |
| <title></title> | |
| <link rel="SHORTCUT ICON" href="/favicon.ico" /> | |
| <link href="App_Themes/portal.css" rel="stylesheet" type="text/css" /> | |
| </head> | |
| <body> | |
| <form id="form1" runat="server"> | |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> | |
| <telerik:RadSplitter ID="RadSplitterMain" runat="server" Width="100%" Height="100%"> | |
| <telerik:RadPane ID="LeftPane" runat="server" Width="179" Scrolling="None" MinWidth="179" | |
| EnableViewState="true"> | |
| <telerik:RadPanelBar ID="LeftPanelBar" runat="server" Width="100%" Skin="Sunset"> | |
| <ExpandAnimation Type="InOutSine" /> | |
| </telerik:RadPanelBar> | |
| </telerik:RadPane> | |
| <telerik:RadSplitBar ID="RadSplitbarMain" runat="server" CollapseMode="Forward" SkinID="Office2007"> | |
| </telerik:RadSplitBar> | |
| <telerik:RadPane ID="ContentPane" runat="server" Width="100%" MinWidth="1000" BackColor="#ffffff"> | |
| <div id="TH_Content"> | |
| <asp:ContentPlaceHolder ID="PlaceHolderMainContent" runat="Server"> | |
| <!-- Content Goes Here --> | |
| </asp:ContentPlaceHolder> | |
| </div> | |
| </telerik:RadPane> | |
| </telerik:RadSplitter> | |
| </form> | |
| </body> | |
| </html> |
| protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| if (e.CommandName == "Delete") |
| { |
| string ActionType = "DELETE"; |
| string Username = Session["Username"].ToString(); |
| string ServiceTypeName = "Website"; |
| string ServiceName; |
| string Fields; |
| string DateInserted = DateTime.Now.TimeOfDay.ToString(); |
| //Setup parameters from RadGrid columns |
| GridDataItem dataformItem = (GridDataItem)e.Item; |
| DataBoundLiteralControl txtbxClientId = (DataBoundLiteralControl)dataformItem["Client"].Controls[0]; |
| string ClientId = txtbxClientId.Text; |
| DataBoundLiteralControl txtbxServerId = (DataBoundLiteralControl)dataformItem["Server"].Controls[0]; |
| string ServerId = txtbxServerId.Text; |
| TableCell txtbxWebsiteUrl = (TableCell)dataformItem["WebsiteUrl"]; |
| string WebsiteUrl = txtbxWebsiteUrl.Text; |
| TableCell txtbxLogFilePath = (TableCell)dataformItem["LogFilePath"]; |
| string LogFilePath = txtbxLogFilePath.Text; |
| TableCell txtbxBandWidthCost = (TableCell)dataformItem["BandWidthCost"]; |
| string BandWidthCost = txtbxBandWidthCost.Text; |
| DataBoundLiteralControl txtbxChargeTypeId = (DataBoundLiteralControl)dataformItem["Charge"].Controls[0]; |
| string ChargeTypeId = txtbxChargeTypeId.Text; |
| TableCell txtbxAmount = (TableCell)dataformItem["Amount"]; |
| string Amount = txtbxAmount.Text; |
| TableCell txtbxBandWidthLimit = (TableCell)dataformItem["BandWidthlimit"]; |
| string BandWidthLimit = txtbxBandWidthLimit.Text; |
| CheckBox chkbxSqlDataBase = (CheckBox)dataformItem["SqlDatabase"].Controls[0]; |
| if (chkbxSqlDataBase.Checked == true) |
| { |
| chkbxSqlDataBase.Text = "1"; |
| } |
| else |
| { |
| chkbxSqlDataBase.Text = "0"; |
| } |
| string SqlDataBase = chkbxSqlDataBase.Text; |
| TableCell txtbxSqlMbLimit = (TableCell)dataformItem["SqlMbLimit"]; |
| string SqlMbLimit = txtbxSqlMbLimit.Text; |
| TableCell txtbxMbCharge = (TableCell)dataformItem["MbCharge"]; |
| string MbCharge = txtbxMbCharge.Text; |
| //Setup concatanated Fields parameter. |
| Fields = string.Format("{0};{1};{2};{3};{4};{5};{6};{7};{8};{9};{10}", ClientId, ServerId, WebsiteUrl, LogFilePath, BandWidthCost, ChargeTypeId, Amount, BandWidthLimit, SqlDataBase, SqlMbLimit, MbCharge); |
| ServiceName = WebsiteUrl; |
| //Execute Audit SP and pass through parameters |
| //LINQ |
| cknetispservicesDataContext db = new cknetispservicesDataContext(); |
| var testDs = db.spAudit(ActionType, Username, ServiceTypeName, ServiceName, Fields, Convert.ToDateTime(DateInserted)); |
| } |
| } |

