Re: Control error Asp.Net 2.0

  •  04-19-2006, 12:18 PM

    Re: Control error Asp.Net 2.0

    Sorry for the delay. Here is the source...
     
    <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="insertQuestion.aspx.vb" Inherits="insertQuestionAnswer" title="Commercial User Support" %>

    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>

     

    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <atlas:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server" />

     

     

    &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;

    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="QuestionID"

    DataSourceID="SqlDataSourceQuestions" DefaultMode="Insert" Height="50px" Style="position: static"

    Width="500px" CellPadding="3" EnableViewState="False">

    <Fields>

    <asp:TemplateField HeaderText="System Name" SortExpression="SystemName">

    <EditItemTemplate>

    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("SystemName") %>'></asp:TextBox>

    </EditItemTemplate>

    <InsertItemTemplate>

    &nbsp;<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="False" DataSourceID="ObjectDataSourceSystemName"

    SelectedValue='<%# Bind("SystemName") %>'

    Style="position: static" DataTextField="SystemName" DataValueField="SystemName">

    </asp:DropDownList>

    </InsertItemTemplate>

    <ItemTemplate>

    <asp:Label ID="Label3" runat="server" Text='<%# Bind("SystemName") %>'></asp:Label>

    </ItemTemplate>

    </asp:TemplateField>

    <asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" />

    <asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="LastName" />

    <asp:BoundField DataField="telephone" HeaderText="Telephone" SortExpression="telephone" />

    <asp:BoundField DataField="Email" HeaderText="Email" NullDisplayText="True" SortExpression="Email" />

    <asp:BoundField DataField="QuestionID" HeaderText="QuestionID" InsertVisible="False"

    ReadOnly="True" SortExpression="QuestionID" Visible="False" />

    <asp:TemplateField HeaderText="Caller Type" SortExpression="CallerType">

    <EditItemTemplate>

    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("CallerType") %>'></asp:TextBox>

    </EditItemTemplate>

    <InsertItemTemplate>

     

    <asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="False" DataSourceID="SqlDataSourceCallerType"

    DataTextField="CallerType" DataValueField="CallerType" SelectedValue='<%# Bind("CallerType") %>'

    Style="position: static">

    </asp:DropDownList>

    </InsertItemTemplate>

    <ItemTemplate>

    <asp:Label ID="Label4" runat="server" Text='<%# Bind("CallerType") %>'></asp:Label>

    </ItemTemplate>

    </asp:TemplateField>

    <asp:TemplateField HeaderText="Group Name" SortExpression="GroupName">

    <EditItemTemplate>

    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("GroupName") %>'></asp:TextBox>

    </EditItemTemplate>

    <InsertItemTemplate>

    <asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="False" DataSourceID="SqlDataSourceGroupName"

    DataTextField="GroupName" DataValueField="GroupName" SelectedValue='<%# Bind("GroupName") %>'

    Style="position: static">

    </asp:DropDownList>

    </InsertItemTemplate>

    <ItemTemplate>

    <asp:Label ID="Label5" runat="server" Text='<%# Bind("GroupName") %>'></asp:Label>

    </ItemTemplate>

    </asp:TemplateField>

    <asp:TemplateField HeaderText="Question Type" SortExpression="QuestionType">

    <EditItemTemplate>

    <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("QuestionType") %>'></asp:TextBox>

    </EditItemTemplate>

    <InsertItemTemplate>

    &nbsp;<asp:DropDownList ID="DropDownList4" runat="server" AutoPostBack="False" DataSourceID="SqlDataSourceQuestionType"

    DataTextField="QuestionType" DataValueField="QuestionType" SelectedValue='<%# Bind("QuestionType") %>'

    Style="position: static">

    </asp:DropDownList>

    </InsertItemTemplate>

    <ItemTemplate>

    <asp:Label ID="Label6" runat="server" Text='<%# Bind("QuestionType") %>'></asp:Label>

    </ItemTemplate>

    </asp:TemplateField>

    <asp:TemplateField HeaderText="Question" SortExpression="Question">

    <EditItemTemplate>

     

    <br />

    </EditItemTemplate>

    <InsertItemTemplate>

    <ce:Editor id = "Question" AllowPasteHtml="true" EditorWysiwygModeCss="example.css" TemplateItemList="Bold,Italic,Underline" Height=80 Width=450 ShowBottomBar="false" Text='<%# Bind("Question") %>' runat = "Server">

    </CE:Editor>

     

     

     

     

     

     

    </InsertItemTemplate>

    <ItemTemplate>

    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Question") %>'></asp:Label>

    </ItemTemplate>

    </asp:TemplateField>

    <asp:TemplateField HeaderText="Answer" SortExpression="Answer">

    <EditItemTemplate>

    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Answer") %>'></asp:TextBox>

    </EditItemTemplate>

    <InsertItemTemplate>

    <ce:Editor id = "Answer" AllowPasteHtml="true" EditorWysiwygModeCss="example.css" Height=80 Width=450 ShowBottomBar="false" Text='<%# Bind("Answer") %>' runat="Server" ThemeType="Office2003_BlueTheme" AutoConfigure="Simple"></CE:Editor>

     

    </InsertItemTemplate>

    <ItemTemplate>

    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Answer") %>'></asp:Label>

    </ItemTemplate>

    </asp:TemplateField>

    <asp:BoundField DataField="ExistingQuestionID" HeaderText="ExistingQuestionID" InsertVisible="False"

    SortExpression="ExistingQuestionID" Visible="False" />

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

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

    <asp:BoundField DataField="ActionRequired" HeaderText="Action Required" SortExpression="ActionRequired" >

    <ControlStyle Width="300px" />

    <ItemStyle Width="300px" />

    </asp:BoundField>

    <asp:TemplateField HeaderText="Comments" SortExpression="Comments">

    <EditItemTemplate>

    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Comments") %>'></asp:TextBox>

    </EditItemTemplate>

    <InsertItemTemplate>

    <ce:Editor id = "Comments" AllowPasteHtml="true" EditorWysiwygModeCss="example.css" TemplateItemList="Bold,Italic,Underline" Height=80 Width=450 ShowBottomBar="false" Text='<%# Bind("Comments") %>' runat = "Server">

    </CE:Editor> </InsertItemTemplate>

    <ItemTemplate>

    <asp:Label ID="Label7" runat="server" Text='<%# Bind("Comments") %>'></asp:Label>

    </ItemTemplate>

    </asp:TemplateField>

    <asp:BoundField DataField="SupportPerson" HeaderText="SupportPerson" SortExpression="SupportPerson"

    Visible="False" />

    <asp:CommandField ShowInsertButton="True" ButtonType="Button" >

    <ItemStyle Font-Size="Small" HorizontalAlign="Right" />

    </asp:CommandField>

    <asp:BoundField DataField="dateEntered" HeaderText="dateEntered" InsertVisible="False"

    SortExpression="dateEntered" />

    </Fields>

    </asp:DetailsView>

     

     

     

     

    &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;

    <asp:SqlDataSource ID="SqlDataSourceQuestionType" runat="server" ConnectionString="<%$ ConnectionStrings:CLASupportConnectionString %>"

    SelectCommand="SELECT DISTINCT [QuestionType] FROM [QuestionType]"></asp:SqlDataSource>

     

    <asp:SqlDataSource ID="SqlDataSourceQuestions" runat="server" ConnectionString="<%$ ConnectionStrings:CLASupportConnectionString %>"

    DeleteCommand="DELETE FROM [Questions] WHERE [QuestionID] = @QuestionID" InsertCommand="INSERT INTO [Questions] ([CallerType], [QuestionType], [SystemName], [ExistingQuestionID], [Question], [Answer], [Status], [FirstName], [LastName], [Email], [ActionRequired], [Comments], [SupportPerson], [GroupName], [Hudson], [dateEntered], [telephone]) VALUES (@CallerType, @QuestionType, @SystemName, @ExistingQuestionID, @Question, @Answer, @Status, @FirstName, @LastName, @Email, @ActionRequired, @Comments, @SupportPerson, @GroupName, @Hudson, Current_TimeStamp, @telephone)"

    SelectCommand="SELECT * FROM [Questions]" UpdateCommand="UPDATE [Questions] SET [CallerType] = @CallerType, [QuestionType] = @QuestionType, [SystemName] = @SystemName, [ExistingQuestionID] = @ExistingQuestionID, [Question] = @Question, [Answer] = @Answer, [Status] = @Status, [FirstName] = @FirstName, [LastName] = @LastName, [Email] = @Email, [ActionRequired] = @ActionRequired, [Comments] = @Comments, [SupportPerson] = @SupportPerson, [GroupName] = @GroupName, [Hudson] = @Hudson, [dateEntered] = @dateEntered, [telephone] = @telephone WHERE [QuestionID] = @QuestionID">

    <DeleteParameters>

    <asp:Parameter Name="QuestionID" Type="Int32" />

    </DeleteParameters>

    <UpdateParameters>

    <asp:Parameter Name="CallerType" Type="String" />

    <asp:Parameter Name="QuestionType" Type="String" />

    <asp:Parameter Name="SystemName" Type="String" />

    <asp:Parameter Name="ExistingQuestionID" Type="Int32" />

    <asp:Parameter Name="Question" Type="String" />

    <asp:Parameter Name="Answer" Type="String" />

    <asp:Parameter Name="Status" Type="Boolean" />

    <asp:Parameter Name="FirstName" Type="String" />

    <asp:Parameter Name="LastName" Type="String" />

    <asp:Parameter Name="Email" Type="String" />

    <asp:Parameter Name="ActionRequired" Type="String" />

    <asp:Parameter Name="Comments" Type="String" />

    <asp:Parameter Name="SupportPerson" Type="String" />

    <asp:Parameter Name="GroupName" Type="String" />

    <asp:Parameter Name="Hudson" Type="Boolean" />

    <asp:Parameter Name="dateEntered" Type="DateTime" />

    <asp:Parameter Name="telephone" Type="String" />

    <asp:Parameter Name="QuestionID" Type="Int32" />

    </UpdateParameters>

    <InsertParameters>

    <asp:Parameter Name="CallerType" Type="String" />

    <asp:Parameter Name="QuestionType" Type="String" />

    <asp:Parameter Name="SystemName" Type="String" />

    <asp:Parameter Name="ExistingQuestionID" Type="Int32" />

    <asp:Parameter Name="Question" Type="String" />

    <asp:Parameter Name="Answer" Type="String" />

    <asp:Parameter Name="Status" Type="Boolean" />

    <asp:Parameter Name="FirstName" Type="String" />

    <asp:Parameter Name="LastName" Type="String" />

    <asp:Parameter Name="Email" Type="String" />

    <asp:Parameter Name="ActionRequired" Type="String" />

    <asp:Parameter Name="Comments" Type="String" />

    <asp:Parameter Name="SupportPerson" Type="String" />

    <asp:Parameter Name="GroupName" Type="String" />

    <asp:Parameter Name="Hudson" Type="Boolean" />

    <asp:Parameter Name="dateEntered" Type="DateTime" />

    <asp:Parameter Name="telephone" Type="String" />

    </InsertParameters>

    </asp:SqlDataSource>

     

     

     

     

    <asp:SqlDataSource ID="SqlDataSourceCallerType" runat="server" ConnectionString="<%$ ConnectionStrings:CLASupportConnectionString %>"

    DeleteCommand="DELETE FROM [CallerType] WHERE [CallerType] = @CallerType" InsertCommand="INSERT INTO [CallerType] ([CallerType]) VALUES (@CallerType)"

    SelectCommand="SELECT [CallerType] FROM [CallerType]">

    <DeleteParameters>

    <asp:Parameter Name="CallerType" Type="String" />

    </DeleteParameters>

    <InsertParameters>

    <asp:Parameter Name="CallerType" Type="String" />

    </InsertParameters>

    </asp:SqlDataSource>

    &nbsp;&nbsp;

    <asp:SqlDataSource ID="SqlDataSourceGroupName" runat="server" ConnectionString="<%$ ConnectionStrings:CLASupportConnectionString %>"

    SelectCommand="SELECT DISTINCT [GroupName] FROM [Group]"></asp:SqlDataSource>

    <asp:ObjectDataSource ID="ObjectDataSourceSystemName" runat="server" OldValuesParameterFormatString="original_{0}"

    SelectMethod="GetSystemName" TypeName="CLASupportTableAdapters.SystemNameTableAdapter">

    </asp:ObjectDataSource>

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

    DeleteCommand="DELETE FROM [Questions] WHERE [QuestionID] = @QuestionID" InsertCommand="INSERT INTO [Questions] ([CallerType], [QuestionType], [SystemName], [ExistingQuestionID], [Question], [Answer], [Status], [FirstName], [LastName], [Email], [ActionRequired], [Comments], [SupportPerson], [GroupName], [Hudson], [dateEntered], [telephone]) VALUES (@CallerType, @QuestionType, @SystemName, @ExistingQuestionID, @Question, @Answer, @Status, @FirstName, @LastName, @Email, @ActionRequired, @Comments, @SupportPerson, @GroupName, @Hudson, @dateEntered, @telephone)"

    SelectCommand="SELECT * FROM [Questions]" UpdateCommand="UPDATE [Questions] SET [CallerType] = @CallerType, [QuestionType] = @QuestionType, [SystemName] = @SystemName, [ExistingQuestionID] = @ExistingQuestionID, [Question] = @Question, [Answer] = @Answer, [Status] = @Status, [FirstName] = @FirstName, [LastName] = @LastName, [Email] = @Email, [ActionRequired] = @ActionRequired, [Comments] = @Comments, [SupportPerson] = @SupportPerson, [GroupName] = @GroupName, [Hudson] = @Hudson, [dateEntered] = @dateEntered, [telephone] = @telephone WHERE [QuestionID] = @QuestionID">

    <DeleteParameters>

    <asp:Parameter Name="QuestionID" Type="Int32" />

    </DeleteParameters>

    <UpdateParameters>

    <asp:Parameter Name="CallerType" Type="String" />

    <asp:Parameter Name="QuestionType" Type="String" />

    <asp:Parameter Name="SystemName" Type="String" />

    <asp:Parameter Name="ExistingQuestionID" Type="Int32" />

    <asp:Parameter Name="Question" Type="String" />

    <asp:Parameter Name="Answer" Type="String" />

    <asp:Parameter Name="Status" Type="Boolean" />

    <asp:Parameter Name="FirstName" Type="String" />

    <asp:Parameter Name="LastName" Type="String" />

    <asp:Parameter Name="Email" Type="String" />

    <asp:Parameter Name="ActionRequired" Type="String" />

    <asp:Parameter Name="Comments" Type="String" />

    <asp:Parameter Name="SupportPerson" Type="String" />

    <asp:Parameter Name="GroupName" Type="String" />

    <asp:Parameter Name="Hudson" Type="Boolean" />

    <asp:Parameter Name="dateEntered" Type="DateTime" />

    <asp:Parameter Name="telephone" Type="String" />

    <asp:Parameter Name="QuestionID" Type="Int32" />

    </UpdateParameters>

    <InsertParameters>

    <asp:Parameter Name="CallerType" Type="String" />

    <asp:Parameter Name="QuestionType" Type="String" />

    <asp:Parameter Name="SystemName" Type="String" />

    <asp:Parameter Name="ExistingQuestionID" Type="Int32" />

    <asp:Parameter Name="Question" Type="String" />

    <asp:Parameter Name="Answer" Type="String" />

    <asp:Parameter Name="Status" Type="Boolean" />

    <asp:Parameter Name="FirstName" Type="String" />

    <asp:Parameter Name="LastName" Type="String" />

    <asp:Parameter Name="Email" Type="String" />

    <asp:Parameter Name="ActionRequired" Type="String" />

    <asp:Parameter Name="Comments" Type="String" />

    <asp:Parameter Name="SupportPerson" Type="String" />

    <asp:Parameter Name="GroupName" Type="String" />

    <asp:Parameter Name="Hudson" Type="Boolean" />

    <asp:Parameter Name="dateEntered" Type="DateTime" />

    <asp:Parameter Name="telephone" Type="String" />

    </InsertParameters>

    </asp:SqlDataSource>

    <br />

     

     

    <script type="text/xml-script">

    <page xmlns:script="http://schemas.microsoft.com/xml-script/2005">

    <references>

    </references>

    <components>

    </components>

    </page>

    </script>

    </asp:Content>

     

View Complete Thread