these is the problem:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0118: 'System.Web.UI.WebControls.SqlDataSource' is a 'type' but is used like a 'variable'
Source Error:
Line 31:
Line 32:
Line 33: " runat="server"
Line 35: DataSourceID="SqlDataSource1"
This is my codes:
<asp:ListView ID="ListView1" GroupItemCount="3" DataKeyNames="pic_id"
DataSource="<%# SqlDataSource %>" runat="server"
DataSourceID="SqlDataSource1"
onselectedindexchanged="ListView1_SelectedIndexChanged">
<AlternatingItemTemplate>
<td runat="server" style="background-color: #FFFFFF;color: #284775;">
pic_id:
<asp:Label ID="pic_idLabel" runat="server" Text='<%# Eval("pic_id") %>' />
<br />
picture_tag:
<asp:Label ID="picture_tagLabel" runat="server"
Text='<%# Eval("picture_tag") %>' />
<br />
pic:
<asp:Label ID="picLabel" runat="server" Text='<%# Eval("pic") %>' />
<br />
</td>
</AlternatingItemTemplate>
<EmptyDataTemplate>
<table runat="server"
style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
<tr>
<td>
No data was returned.</td>
</tr>
</table>
</EmptyDataTemplate>
<InsertItemTemplate>
<td runat="server" style="">
picture_tag:
<asp:TextBox ID="picture_tagTextBox" runat="server"
Text='<%# Bind("picture_tag") %>' />
<br />
pic:
<asp:TextBox ID="picTextBox" runat="server" Text='<%# Bind("pic") %>' />
<br />
<asp:Button ID="InsertButton" runat="server" CommandName="Insert"
Text="Insert" />
<br />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel"
Text="Clear" />
<br />
</td>
</InsertItemTemplate>
<LayoutTemplate>
<table runat="server">
<tr runat="server">
<td runat="server">
<table ID="groupPlaceholderContainer" runat="server" border="1"
style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
<tr ID="groupPlaceholder" runat="server">
</tr>
</table>
</td>
</tr>
<tr runat="server">
<td runat="server"
style="text-align: center;background-color: #5D7B9D;font-family: Verdana, Arial, Helvetica, sans-serif;color: #FFFFFF">
<asp:DataPager ID="DataPager1" runat="server" PageSize="12">
<Fields>
<asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True"
ShowLastPageButton="True" />
</Fields>
</asp:DataPager>
</td>
</tr>
</table>
</LayoutTemplate>
<EditItemTemplate>
<td runat="server" style="background-color: #999999;">
pic_id:
<asp:Label ID="pic_idLabel1" runat="server" Text='<%# Eval("pic_id") %>' />
<br />
picture_tag:
<asp:TextBox ID="picture_tagTextBox" runat="server"
Text='<%# Bind("picture_tag") %>' />
<br />
pic:
<asp:TextBox ID="picTextBox" runat="server" Text='<%# Bind("pic") %>' />
<br />
<asp:Button ID="UpdateButton" runat="server" CommandName="Update"
Text="Update" />
<br />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel"
Text="Cancel" />
<br />
</td>
</EditItemTemplate>
<GroupTemplate>
<tr ID="itemPlaceholderContainer" runat="server">
<td ID="itemPlaceholder" runat="server">
</td>
</tr>
</GroupTemplate>
<EmptyItemTemplate>
<td runat="server" />
</EmptyItemTemplate>
<ItemTemplate>
<td runat="server" style="background-color: #E0FFFF;color: #333333;">
pic_id:
<asp:Label ID="pic_idLabel" runat="server" Text='<%# Eval("pic_id") %>' />
<br />
picture_tag:
<asp:Label ID="picture_tagLabel" runat="server"
Text='<%# Eval("picture_tag") %>' />
<br />
pic:
<asp:Label ID="picLabel" runat="server" Text='<%# Eval("pic") %>' />
<br />
</td>
</ItemTemplate>
<SelectedItemTemplate>
<td runat="server"
style="background-color: #E2DED6;font-weight: bold;color: #333333;">
pic_id:
<asp:Label ID="pic_idLabel" runat="server" Text='<%# Eval("pic_id") %>' />
<br />
picture_tag:
<asp:Label ID="picture_tagLabel" runat="server"
Text='<%# Eval("picture_tag") %>' />
<br />
pic:
<asp:Label ID="picLabel" runat="server" Text='<%# Eval("pic") %>' />
<br />
</td>
</SelectedItemTemplate>
</asp:ListView>
Remove DataSource="<%# SqlDataSource %>"
from the ListView definition
If you have bind listview from back end than you can't add Datasource on front size...
Related
I have an aspx page containing a grid-view. During a post-back of the grid, the data bound to the grid-view are lost. What could be the reason?
I have attached code below which the user input data on controls disappears when the image button is clicked.
aspx page:
<telerik:RadGrid ID="GridOfficeInfo" runat="server" AllowMultiRowSelection="false" OnItemCommand="GridOfficeInfo_ItemCommand" BorderWidth="0" AutoGenerateColumns="false" Width="100%" Visible="true" >
<MasterTableView>
<Columns>
<telerik:GridTemplateColumn>
<HeaderStyle BorderWidth="0" HorizontalAlign="Center" CssClass="OfficeInfoHeader" />
<ItemStyle BorderWidth="0" HorizontalAlign="Center" CssClass="OfficeRow" />
<HeaderTemplate>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left">
<asp:Label runat="server" ID="Label1" Text="Office Info" CssClass="Label">
</asp:Label>
</td>
<%-- <td align="right">
<asp:LinkButton ID="lnkOfficeInfo" runat="server" Font-Underline="true" Text="Click here for map" OnClick="lnkOfficeInfo_Click" CssClass="Label">
</asp:LinkButton>
</td>
--%>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table id="TableOfficeinfo" border="0" width="100%" runat="server">
<col style="width:16%;" />
<col style="width:18%;" />
<col style="width:15%;" />
<col style="width:18%;" />
<col style="width:15%;" />
<col style="width:18%;" />
<tr>
<td align="left" colspan="2" style="border-width:0;">
<asp:Label ID="LblOffice" Text="Primary Practice Location" runat="server" CssClass="LabelItalics">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<asp:Label ID="LblBillAdd" Text="Billing Address" runat="server" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<asp:CheckBox runat="server" ID="ChkBillAdd" Checked="false" CssClass="ProviderCb" AutoPostBack="true" OnCheckedChanged="ChkBillAdd_CheckedChanged" />
</td>
<td align="right" colspan="2" style="border-width:0;">
<asp:LinkButton ID="lnkOfficeMap" runat="server" Font-Underline="true" Text="Click here for map" OnClick="lnkOfficeInfo_Click" CssClass="Label">
</asp:LinkButton>
</td>
</tr>
<tr>
<td align="left" style="border-width:0;">
<asp:Label ID="LblStreet" Text="Street Address" runat="server" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<asp:TextBox runat="server" ID="TxtStreet" Text='<%#Eval("StreetAddress")%>' Enabled="false" CssClass="ProviderTextbox">
</asp:TextBox>
</td>
<td align="left" style="border-width:0;">
<asp:Label ID="LblSuite" Text="Suite" runat="server" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<asp:TextBox runat="server" ID="TxtSuite" Text='<%#Eval("Suite")%>' Enabled="false" CssClass="ProviderTextbox">
</asp:TextBox>
</td>
<td align="left" style="border-width:0;">
<asp:Label runat="server" ID="LblCity" Text="City" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<asp:TextBox runat="server" ID="TxtCity" Text='<%#Eval("City")%>' Enabled="false" CssClass="ProviderTextbox">
</asp:TextBox>
</td>
</tr>
<tr>
<td align="left" style="border-width:0;">
<asp:Label ID="LblState" Text="State" runat="server" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<asp:TextBox runat="server" ID="TxtState" Text='<%#Eval("State")%>' Enabled="false" CssClass="ProviderTextbox">
</asp:TextBox>
<telerik:RadComboBox runat="server" ID="cbOfficeInfo" CssClass="ProviderCombo" Visible="false" EnableTextSelection="true" SortCaseSensitive="false" Height="100">
<Items>
<telerik:RadComboBoxItem runat="server" Text="Choose State" />
<telerik:RadComboBoxItem runat="server" Text="AL" />
<telerik:RadComboBoxItem runat="server" Text="AK" />
<telerik:RadComboBoxItem runat="server" Text="AZ" />
<telerik:RadComboBoxItem runat="server" Text="AR" />
<telerik:RadComboBoxItem runat="server" Text="CA" />
<telerik:RadComboBoxItem runat="server" Text="CO" />
<telerik:RadComboBoxItem runat="server" Text="CT" />
<telerik:RadComboBoxItem runat="server" Text="DE" />
<telerik:RadComboBoxItem runat="server" Text="DC" />
<telerik:RadComboBoxItem runat="server" Text="FL" />
<telerik:RadComboBoxItem runat="server" Text="GA" />
<telerik:RadComboBoxItem runat="server" Text="HI" />
<telerik:RadComboBoxItem runat="server" Text="ID" />
<telerik:RadComboBoxItem runat="server" Text="IL" />
<telerik:RadComboBoxItem runat="server" Text="IN" />
<telerik:RadComboBoxItem runat="server" Text="IA" />
<telerik:RadComboBoxItem runat="server" Text="KS" />
<telerik:RadComboBoxItem runat="server" Text="KY" />
<telerik:RadComboBoxItem runat="server" Text="LA" />
<telerik:RadComboBoxItem runat="server" Text="ME" />
<telerik:RadComboBoxItem runat="server" Text="MD" />
<telerik:RadComboBoxItem runat="server" Text="MA" />
<telerik:RadComboBoxItem runat="server" Text="MI" />
<telerik:RadComboBoxItem runat="server" Text="MN" />
<telerik:RadComboBoxItem runat="server" Text="MS" />
<telerik:RadComboBoxItem runat="server" Text="MO" />
<telerik:RadComboBoxItem runat="server" Text="MT" />
<telerik:RadComboBoxItem runat="server" Text="NE" />
<telerik:RadComboBoxItem runat="server" Text="NV" />
<telerik:RadComboBoxItem runat="server" Text="NH" />
<telerik:RadComboBoxItem runat="server" Text="NJ" />
<telerik:RadComboBoxItem runat="server" Text="NM" />
<telerik:RadComboBoxItem runat="server" Text="NY" />
<telerik:RadComboBoxItem runat="server" Text="NC" />
<telerik:RadComboBoxItem runat="server" Text="ND" />
<telerik:RadComboBoxItem runat="server" Text="OH" />
<telerik:RadComboBoxItem runat="server" Text="OK" />
<telerik:RadComboBoxItem runat="server" Text="OR" />
<telerik:RadComboBoxItem runat="server" Text="PA" />
<telerik:RadComboBoxItem runat="server" Text="RI" />
<telerik:RadComboBoxItem runat="server" Text="SC" />
<telerik:RadComboBoxItem runat="server" Text="SD" />
<telerik:RadComboBoxItem runat="server" Text="TN" />
<telerik:RadComboBoxItem runat="server" Text="TX" />
<telerik:RadComboBoxItem runat="server" Text="UT" />
<telerik:RadComboBoxItem runat="server" Text="VT" />
<telerik:RadComboBoxItem runat="server" Text="VA" />
<telerik:RadComboBoxItem runat="server" Text="WA" />
<telerik:RadComboBoxItem runat="server" Text="WV" />
<telerik:RadComboBoxItem runat="server" Text="WI" />
<telerik:RadComboBoxItem runat="server" Text="WY" />
</Items>
</telerik:RadComboBox>
</td>
<td align="left" style="border-width:0;">
<asp:Label ID="LblZip" Text="Zip" runat="server" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<asp:TextBox runat="server" ID="TxtZip" Text='<%#Eval("Zip")%>' Enabled="false" CssClass="ProviderTextbox">
</asp:TextBox>
</td>
<td align="left" style="border-width:0;">
<asp:Label runat="server" ID="LblContact" Text="Office Contact" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<asp:TextBox runat="server" ID="TxtContact" Text='<%#Eval("OfficeContact")%>' Enabled="true" CssClass="ProviderTextbox">
</asp:TextBox>
</td>
</tr>
<tr>
<td align="left" style="border-width:0;">
<asp:Label ID="LblEMRUsed" Text="EMR Used" runat="server" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<telerik:RadComboBox runat="server" ID="CbEMRUsed" EnableTextSelection="true" CssClass="ProviderCombo" AutoPostBack="true" OnSelectedIndexChanged="CbEMRUsed_SelectedIndexChanged">
<Items>
<telerik:RadComboBoxItem runat="server" Text="Yes" />
<telerik:RadComboBoxItem runat="server" Text="No" />
</Items>
</telerik:RadComboBox>
</td>
<td align="left" style="border-width:0;">
<asp:Label ID="LblEMRName" Text="EMR Name" runat="server" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<telerik:RadComboBox runat="server" ID="CbEMRName" EnableTextSelection="true" CssClass="ProviderCombo" Height="200">
<Items>
<telerik:RadComboBoxItem runat="server" Text="Select" Selected="true" />
</Items>
</telerik:RadComboBox>
</td>
<td align="left" style="border-width:0;">
<asp:Label runat="server" ID="LblUse" Text="Meaningful Use" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<asp:CheckBox runat="server" ID="MeaningUse" Checked="false" CssClass="ProviderCb" AutoPostBack="true" OnCheckedChanged="MeaningUse_CheckedChanged"/>
</td>
</tr>
<tr>
<td align="left" style="border-width:0;">
<asp:Label ID="LblOffTel1" Text="Office Tel # 1" runat="server" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<telerik:RadMaskedTextBox ID="TxtOffTel1" runat="server" Enabled="false" Mask="(###) ###-####" Width="88.5%" Text='<%#Eval("OfficeTel_1")%>' DisabledStyle-BackColor="#E5E5E5">
</telerik:RadMaskedTextBox>
<%--<asp:TextBox runat="server" ID="TxtOffTel1" Text='<%#Eval("OfficeTel_1")%>' Enabled="false" CssClass="ProviderTextbox">
</asp:TextBox>--%>
</td>
<td align="left" style="border-width:0;">
<asp:Label ID="LblOffTel2" Text="Office Tel # 2" runat="server" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<telerik:RadMaskedTextBox ID="TxtOffTel2" runat="server" Enabled="false" Mask="(###) ###-####" Width="88.5%" Text='<%#Eval("OfficeTel_2")%>' DisabledStyle-BackColor="#E5E5E5">
</telerik:RadMaskedTextBox>
<%--<asp:TextBox runat="server" ID="TxtOffTel2" Text='<%#Eval("OfficeTel_2")%>' Enabled="false" CssClass="ProviderTextbox">
</asp:TextBox>--%>
</td>
<td align="left" style="border-width:0;">
<asp:Label runat="server" ID="LblOffFax" Text="Office Fax" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<telerik:RadMaskedTextBox ID="TxtOffFax" runat="server" Enabled="false" Mask="(###) ###-####" Width="88.5%" Text='<%#Eval("OfficeFax")%>' DisabledStyle-BackColor="#E5E5E5">
</telerik:RadMaskedTextBox>
<%--<asp:TextBox runat="server" ID="TxtOffFax" Text='<%#Eval("OfficeFax")%>' Enabled="false" CssClass="ProviderTextbox">
</asp:TextBox>--%>
</td>
</tr>
<tr>
<td align="left" style="border-width:0;">
<asp:Label ID="LblIDTCount" Text="IDT Assigned Count" runat="server" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<asp:TextBox runat="server" ID="TxtIDTCount" Text='<%#Eval("IDTAssignedCount")%>' Enabled="false" CssClass="ProviderTextbox">
</asp:TextBox>
</td>
<td align="left" style="border-width:0;">
<asp:Label ID="LblLastDate" Text="Last Visit Date" runat="server" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<telerik:RadDatePicker runat="server" ID="DpLastDate" CssClass="ProviderDtpicker">
<DateInput DateFormat="MM/dd/yyyy">
</DateInput>
</telerik:RadDatePicker>
</td>
<td align="left" style="border-width:0;">
<asp:Label runat="server" ID="LblWaitTime" Text="Avg. Wait Time" CssClass="Label">
</asp:Label>
</td>
<td align="left" style="border-width:0;">
<asp:TextBox runat="server" ID="TxtWaitTime" Text='<%#Eval("AvgWaitTime")%>' Enabled="false" CssClass="ProviderTextbox">
</asp:TextBox>
</td>
</tr>
<tr id="trAddOffice" runat="server">
<td align="left" colspan="6" style="border-width:0;">
<asp:ImageButton ID="AddOfficeRow" runat="server" UseSubmitBehavior="false" ImageUrl="~/Images/AddDiag1.png" OnClick="AddOfficeRow_Click" />
</td>
</tr>
</table>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings >
</ClientSettings>
</telerik:RadGrid>
aspx.cs page
protected void AddOfficeRow_Click(object sender, ImageClickEventArgs e)
{
//int Rno = GridOfficeInfo.Items.Count + 1;
int Rno = GridOfficeInfo.Items.Count + 1;
PopulateGridOfficeInfo(Rno);
}
public void PopulateGridOfficeInfo(int RowNo)
{
//bool[] bBillingAddress = new bool[RowNo - 1];
//bool[] bMeaningfulUse = new bool[RowNo - 1];
string strCbEMRUsed = string.Empty;
string strCbEMRName = string.Empty;
string strcbOfficeInfo = string.Empty;
DataTable dt = new DataTable();
dt.Columns.Add("StreetAddress");//Text='<%#Eval("StreetAddress")%>'
dt.Columns.Add("Suite");//
dt.Columns.Add("City");//
dt.Columns.Add("State");//
dt.Columns.Add("Zip");//
dt.Columns.Add("OfficeContact");//
dt.Columns.Add("OfficeTel_1");//
dt.Columns.Add("OfficeTel_2");//
dt.Columns.Add("OfficeFax");//
dt.Columns.Add("IDTAssignedCount");//
//dt.Columns.Add("LastDate", typeof(DateTime?));
dt.Columns.Add("AvgWaitTime");//
for (int i = 0; i < RowNo; i++)
{
//string lnkOfficeMap = string.Empty;
string StreetAddress = string.Empty;
string Suite = string.Empty;
string City = string.Empty;
string State = string.Empty;
string Zip = string.Empty;
string OfficeContact = string.Empty;
string OfficeTel_1 = string.Empty;
string OfficeTel_2 = string.Empty;
string OfficeFax = string.Empty;
string IDTAssignedCount = string.Empty;
string AvgWaitTime = string.Empty;
if (i < RowNo - RowNo)
{
//bBillingAddress[i] = ((CheckBox)GridOfficeInfo.Items[i].FindControl("ChkBillAdd")).Checked;
//lnkOfficeMap = ((LinkButton)GridOfficeInfo.Items[i].FindControl("Click here for map")).Text;
StreetAddress = ((TextBox)GridOfficeInfo.Items[i].FindControl("TxtStreet")).Text;
Suite = ((TextBox)GridOfficeInfo.Items[i].FindControl("TxtSuite")).Text;
City = ((TextBox)GridOfficeInfo.Items[i].FindControl("TxtCity")).Text;
State = ((TextBox)GridOfficeInfo.Items[i].FindControl("TxtState")).Text;
Zip = ((TextBox)GridOfficeInfo.Items[i].FindControl("TxtZip")).Text;
OfficeContact = ((TextBox)GridOfficeInfo.Items[i].FindControl("TxtContact")).Text;
//bMeaningfulUse[i] = ((CheckBox)GridOfficeInfo.Items[i].FindControl("MeaningUse")).Checked;
OfficeTel_1 = ((RadMaskedTextBox)GridOfficeInfo.Items[i].FindControl("TxtOffTel1")).Text;
//OfficeTel_1 = ((TextBox)GridOfficeInfo.Items[i].FindControl("TxtOffTel1")).Text;
OfficeTel_2 = ((RadMaskedTextBox)GridOfficeInfo.Items[i].FindControl("TxtOffTel2")).Text;
//OfficeTel_2 = ((TextBox)GridOfficeInfo.Items[i].FindControl("TxtOffTel2")).Text;
OfficeFax = ((RadMaskedTextBox)GridOfficeInfo.Items[i].FindControl("TxtOffFax")).Text;
//OfficeFax = ((TextBox)GridOfficeInfo.Items[i].FindControl("TxtOffFax")).Text;
IDTAssignedCount = ((TextBox)GridOfficeInfo.Items[i].FindControl("TxtIDTCount")).Text;
AvgWaitTime = ((TextBox)GridOfficeInfo.Items[i].FindControl("TxtWaitTime")).Text;
}
dt.Rows.Add(StreetAddress, Suite, City, State, Zip, OfficeContact, OfficeTel_1, OfficeTel_2, OfficeFax, IDTAssignedCount, AvgWaitTime);
}
GridOfficeInfo.DataSource = dt;
GridOfficeInfo.DataBind();
}
Use the NeedDataSource event to provide a datasource. My best guess is that it no longer has a datasource after a postback: https://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/simple-vs-advanced/defaultcs.aspx. You will see how often you need to provide datasource when you do it manually.
Similar problems can arise if you disable viewstate too.
I have the following code for my Edit Stored Procedure:
CREATE PROCEDURE [dbo].[sp_EditDates]
#ID int,
#PublishYear int,
#PublishMonth int,
#PayDte varchar(200),
#PublishDte varchar(200)
AS
BEGIN
-- Insert statements for procedure here
UPDATE PaymentAndPublishingDates SET PublishYear = #PublishYear, PublishMonth = #PublishMonth, PayDte = #PayDte, PublishDte = #PublishDte
WHERE ID=#ID;
END
And the following for my Select stored procedure:
CREATE PROCEDURE [dbo].[sp_RetrieveAllDates]
AS BEGIN SELECT DISTINCT
PaymentAndPublishingDates.ID, PaymentAndPublishingDates.PublishYear,
PaymentAndPublishingDates.PublishMonth,
CONVERT(VARCHAR,PaymentAndPublishingDates.PayDte,106)AS PayDate,
CONVERT(VARCHAR,PaymentAndPublishingDates.PublishDte,120) AS PublishDate
FROM PaymentAndPublishingDates
END
And I have a datasource like this:
<asp:ListView ID="ListView1" runat="server" DataSourceID="Payment_Dates"
InsertItemPosition="LastItem">
<AlternatingItemTemplate>
<tr style="background-color:#FFF8DC;">
<td>
<asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
</td>
<td>
<asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
</td>
<td>
<asp:Label ID="PublishYearLabel" runat="server"
Text='<%# Eval("PublishYear") %>' />
</td>
<td>
<asp:Label ID="PublishMonthLabel" runat="server"
Text='<%# Eval("PublishMonth") %>' />
</td>
<td>
<asp:Label ID="PayDateLabel" runat="server" Text='<%# Eval("PayDate") %>' />
</td>
<td>
<asp:Label ID="PublishDateLabel" runat="server"
Text='<%# Eval("PublishDate") %>' />
</td>
</tr>
</AlternatingItemTemplate>
<EditItemTemplate>
<tr style="background-color:#008A8C;color: #FFFFFF;">
<td>
<asp:Button ID="UpdateButton" runat="server" CommandName="Update"
Text="Update" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel"
Text="Cancel" />
</td>
<td>
<asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' />
</td>
<td>
<asp:TextBox ID="PublishYearTextBox" runat="server"
Text='<%# Bind("PublishYear") %>' />
</td>
<td>
<asp:TextBox ID="PublishMonthTextBox" runat="server"
Text='<%# Bind("PublishMonth") %>' />
</td>
<td>
<asp:TextBox ID="PayDateTextBox" runat="server" Text='<%# Bind("PayDate") %>' />
</td>
<td>
<asp:TextBox ID="PublishDateTextBox" runat="server"
Text='<%# Bind("PublishDate") %>' />
</td>
</tr>
</EditItemTemplate>
<EmptyDataTemplate>
<table runat="server"
style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
<tr>
<td>
No data was returned.</td>
</tr>
</table>
</EmptyDataTemplate>
<InsertItemTemplate>
<tr style="">
<td>
<asp:Button ID="InsertButton" runat="server" CommandName="Insert"
Text="Insert" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel"
Text="Clear" />
</td>
<td>
</td>
<td>
<asp:TextBox ID="PublishYearTextBox" runat="server"
Text='<%# Bind("PublishYear") %>' />
</td>
<td>
<asp:TextBox ID="PublishMonthTextBox" runat="server"
Text='<%# Bind("PublishMonth") %>' />
</td>
<td>
<asp:TextBox ID="PayDateTextBox" runat="server" Text='<%# Bind("PayDate") %>' />
</td>
<td>
<asp:TextBox ID="PublishDateTextBox" runat="server"
Text='<%# Bind("PublishDate") %>' />
</td>
</tr>
</InsertItemTemplate>
<ItemTemplate>
<tr style="background-color:#DCDCDC;color: #000000;">
<td>
<asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
</td>
<td>
<asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
</td>
<td>
<asp:Label ID="PublishYearLabel" runat="server"
Text='<%# Eval("PublishYear") %>' />
</td>
<td>
<asp:Label ID="PublishMonthLabel" runat="server"
Text='<%# Eval("PublishMonth") %>' />
</td>
<td>
<asp:Label ID="PayDateLabel" runat="server" Text='<%# Eval("PayDate") %>' />
</td>
<td>
<asp:Label ID="PublishDateLabel" runat="server"
Text='<%# Eval("PublishDate") %>' />
</td>
</tr>
</ItemTemplate>
<LayoutTemplate>
<table runat="server">
<tr runat="server">
<td runat="server">
<table ID="itemPlaceholderContainer" runat="server" border="1"
style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
<tr runat="server" style="background-color:#DCDCDC;color: #000000;">
<th runat="server">
</th>
<th runat="server">
ID</th>
<th runat="server">
PublishYear</th>
<th runat="server">
PublishMonth</th>
<th runat="server">
PayDate</th>
<th runat="server">
PublishDate</th>
</tr>
<tr ID="itemPlaceholder" runat="server">
</tr>
</table>
</td>
</tr>
<tr runat="server">
<td runat="server"
style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
</td>
</tr>
</table>
</LayoutTemplate>
<SelectedItemTemplate>
<tr style="background-color:#008A8C;font-weight: bold;color: #FFFFFF;">
<td>
<asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
</td>
<td>
<asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
</td>
<td>
<asp:Label ID="PublishYearLabel" runat="server"
Text='<%# Eval("PublishYear") %>' />
</td>
<td>
<asp:Label ID="PublishMonthLabel" runat="server"
Text='<%# Eval("PublishMonth") %>' />
</td>
<td>
<asp:Label ID="PayDateLabel" runat="server" Text='<%# Eval("PayDate") %>' />
</td>
<td>
<asp:Label ID="PublishDateLabel" runat="server"
Text='<%# Eval("PublishDate") %>' />
</td>
</tr>
</SelectedItemTemplate>
</asp:ListView>
<asp:SqlDataSource ID="Payment_Dates" runat="server"
ConnectionString="<%$ ConnectionStrings:TUT_ElectronicPayslipsConnectionString %>"
InsertCommand="sp_CapturePayDate" InsertCommandType="StoredProcedure"
SelectCommand="sp_RetrieveAllDates" SelectCommandType="StoredProcedure"
UpdateCommand="sp_EditDates" UpdateCommandType="StoredProcedure">
<InsertParameters>
<asp:Parameter Name="PublishYear" Type="Int32" />
<asp:Parameter Name="PublishMonth" Type="Int32" />
<asp:Parameter Name="PayDte" Type="String" />
<asp:Parameter Name="PublishDte" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="ID" Type="Int32" />
<asp:Parameter Name="PublishYear" Type="Int32" />
<asp:Parameter Name="PublishMonth" Type="Int32" />
<asp:Parameter Name="PayDte" Type="String" />
<asp:Parameter Name="PublishDte" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>
The data displays fine but when I try to edit fields I get this error "Procedure or function sp_EditDates has too many arguments specified".
Please Help
I have a datalist filled with items from database and each item has an image button onclick of which I want to show a modalpopup containing the Description of the particular Item. Below is what I have dine so far but fail:
<asp:DataList ID="DataList1" runat="server" RepeatColumns="3" RepeatDirection="Horizontal" Width="100%">
<ItemTemplate>
<table width="228px">
<tr>
<td width="20px" > </td>
<td width="160px" align="center">
<asp:Label ID="pID" runat="server" Visible="false" Text='<%# Eval("id") %>'></asp:Label><asp:Label ID="Label1" runat="server" Text='<%# Eval("ProductName") %>' Font-Size="8pt" ForeColor="#336699" Width="100%" />
</td>
<td align="right">
<asp:ImageButton ID="SpecificBtn" ImageUrl="images/SmallCallout.png" OnClick="SpecificBtn_Click" CommandArgument='<%# Eval("Id") %>' runat="server" />
<ajaxToolkit:ModalPopupExtender ID="mdl" runat="server" PopupControlID="pnl" TargetControlID="SpecificBtn" Enabled="True" CancelControlID="btn" DropShadow="true" Drag="True" ></ajaxToolkit:ModalPopupExtender>
</td>
</tr>
</table>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# "GetImage.aspx?id=" + Eval("id") %>' /><br />
<table align="center" style="position:relative; left:2px;" cellspacing="0" cellpadding = "0" width="228px">
<tr>
<td style="background-color:Black;" colspan=2>
<div >
<asp:Image ID="Image2" ImageUrl="/images/cart.png" runat="server" />
<asp:Button CommandName="AddToCart" CssClass="anchor" OnClick="addProduct" CausesValidation="false" CommandArgument='<%# Eval("Id") %>' ID="addToHire" runat="server" Text=" Add To Cart " BackColor="Black" BorderColor="Black" BorderStyle="None" ForeColor="#F8CD20" Height="24" Font-Bold="true" Font-Size="10" />
</div>
</td>
</tr>
</table>
<br /><br />
</ItemTemplate>
<ItemStyle CssClass="dataListItemStyle" HorizontalAlign="Center" VerticalAlign="Top" />
</asp:DataList>
<asp:Panel ID="pnl" runat="server" visible="false" Width="300px" Height="300px" BackColor="red">
<asp:Label ID="Label2" runat="server" Text="Specification"></asp:Label>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Specification") %>'></asp:Label>
<asp:Button ID="btn" runat="server" Text="cancel" />
</asp:Panel>
Code behind:
protected void SpecificBtn_Click(object sender, EventArgs e)
{
DataListItem dli = (DataListItem)((ImageButton)sender).Parent;
ModalPopupExtender ModalPopupExtender2 = (ModalPopupExtender)dli.FindControl("mdl");
pnl.Visible = true;
ModalPopupExtender2.Show();
}
Can somebody tell me how to acheive this and where I went wrong. Thanks.
use jquery..
function onimagebuttonclick()
{
$find('BehaviorIDofmodelpopupextender').show();
}
i hope this solves your problem..
I set CausesValidation="false" to my cancel button,But when I click the Cancel button ,the exception(arrow) is displaying for fraction of seconds after the page loads.I tried many ways to disable by adding group name to validator and EnableClientScript property=false to validator but these couldn't help me resolve the problem. Even I checked many threads but no one give the solution.If any body came across this problem please help me.
<form id="form1" runat="server">
<div class="AdminContent">
<asp:Label ID="Label1" runat="server" CssClass="BreadcrumbActiveBig" Text="Group Membership" />
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<br />
<br />
<asp:HiddenField ID="HiddenFieldProfile" runat="server" />
<asp:FormView DefaultMode="Edit" ID="FormView1" runat="server" DataSourceID="PermGroupObjectDataSource1"
OnPreRender="FormView1_PreRender">
<EditItemTemplate>
<table>
<tr>
<td align="left" colspan="3">
<asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="Save" Width="67px"
CssClass="ButtonS1" />
<asp:Button ID="btnCancel" runat="server" OnClick="btnCancel_Click" Text="Cancel"
CssClass="ButtonS1" CausesValidation="false" />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblGrpName" runat="server" Text="Group Name:" Width="138px" />
</td>
<td>
<asp:TextBox ID="GroupNameTextBox" MaxLength="50" runat="server" Text='<%# Bind("GroupName") %>'
Width="337px" ReadOnly="false" />
<asp:RequiredFieldValidator ID="rqrgFldVldtr_GroupName" ControlToValidate="GroupNameTextBox"
Display="Dynamic" ErrorMessage="<" meta:resourcekey="RequiredFieldValidator1Resource2"
runat="server"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblGrpDescr" runat="server" Text="Group Description:" Width="138px" />
</td>
<td>
<asp:TextBox ID="GroupDescrTextBox" MaxLength="255" runat="server" Text='<%# Bind("GroupDescr") %>'
Width="337px" ReadOnly="false" />
</td>
</tr>
<tr>
<asp:Panel ID="managedByPanel" runat="server" Visible="false">
<td>
<asp:Label ID="lblManagedByDescr" runat="server" Text="Managed by:" Width="138px" />
</td>
<td>
<asp:DropDownList ID="managedByDropDownList" runat="server">
<asp:ListItem Value="0" Text="Admin" />
<asp:ListItem Value="1" Text="AP Clerk admin & Admin" />
<asp:ListItem Value="2" Text="POC admin & Admin" />
</asp:DropDownList>
</td>
</asp:Panel>
</tr>
<tr>
<asp:Panel ID="lblFilterPanel" runat="server" Visible="false">
<td>
<asp:Label ID="LabelFilter" runat="server" Text="Exclude From Document Filter" Width="150px" />
</td>
<td>
<asp:CheckBox ID="chbExcludefromDocFilter" runat="server" Checked='<%# Bind("ExcludeFromUserFilter") %>' />
</td>
</asp:Panel>
</tr>
<tr>
<td valign="top">
<asp:Label ID="lblMembers" runat="server" Text="Members:" Width="80px" />
</td>
<td>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div>
<asp:ListBox ID="lbxMembers" runat="server" Style="overflow: auto; width: 500px;
height: 150px;" DataSourceID="MembersObjectDataSource1" DataTextField='ListName'
DataValueField="UName" SelectionMode="Multiple" />
<br />
<asp:ObjectDataSource ID="MembersObjectDataSource1" runat="server" DataObjectTypeName="System.Collections.Generic.List`1[[Accenture.CSTPrague.eAPI.GroupMember, eAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]"
SelectMethod="FetchGroupMembers" TypeName="Accenture.CSTPrague.eAPI.WebDB_Perm"
UpdateMethod="StoreGroupMembers">
<SelectParameters>
<asp:SessionParameter Name="o" SessionField="oPermGroup" Type="Object" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
<asp:Button ID="btnDeleteSelected" runat="server" OnClick="btnDeleteSelected_Click"
Text="Delete Selected" Width="106px" CssClass="ButtonS1" Style="margin: 4px 0px 8px 2px;" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnDeleteSelected" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblUserName" runat="server" Text="User name:" Width="141px" />
</td>
<td>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Panel ID="panel1" runat="server" DefaultButton="btnAdd">
<table>
<tr>
<td valign="top">
<accenture:lookupcontrol id="UserLookup" runat="server" lookupcommand="usr" maxlength="100"
validationgroup="addUser" disablevalidation="true" />
</td>
<td>
<asp:CustomValidator ID="cuvUserName" runat="server" ValidationGroup="addUser" Display="Dynamic"
ErrorMessage="<" EnableClientScript="false" OnServerValidate="cuvUserName_ServerValidate"
ControlToValidate="UserLookup" ValidateEmptyText="true" />
</td>
<td valign="top">
<asp:Button ID="btnAdd" runat="server" OnClick="btnAdd_Click" Text="Add User" ValidationGroup="addUser"
CausesValidation="true" CssClass="ButtonS1" Style="margin: 2px 0px 8px 2px;" />
</td>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnAdd" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
<tr style="vertical-align: top">
<asp:Panel ID="queryConditionPanel" runat="server" Visible="false">
<td>
<asp:Label ID="lblQueryCondition" runat="server" Text="Query Condition:" Width="138px" />
</td>
<td>
<accenture:lengthlimitedmultilinetextbox id="txtQueryCondition" runat="server" text='<%# Bind("QueryCondition") %>'
style="width: 500px" textmode="MultiLine" maxlength="1000" height="100px" cssclass="txtbox" />
</td>
</asp:Panel>
</tr>
</table>
</EditItemTemplate>
<InsertItemTemplate>
Gid:
<asp:TextBox ID="GidTextBox" runat="server" Text='<%# Bind("Gid") %>' /><br />
GroupName:
<asp:TextBox ID="GroupNameTextBox" MaxLength="50" runat="server" Text='<%# Bind("GroupName") %>' /><br />
Id:
<asp:TextBox ID="IdTextBox" runat="server" Text='<%# Bind("Id") %>'></asp:TextBox><br />
GroupDescr:
<asp:TextBox ID="GroupDescrTextBox" MaxLength="255" runat="server" Text='<%# Bind("GroupDescr") %>' /><br />
ExcludeFromUserFilter:
<asp:CheckBox ID="chbExcludefromDocFilter" runat="server" Checked='<%# Bind("ExcludeFromUserFilter") %>' /><br />
Members:
<asp:TextBox ID="MembersTextBox" runat="server" Text='<%# Bind("Members") %>' /><br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
Text="Insert" />
<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
Gid:
<asp:Label ID="GidLabel" runat="server" Text='<%# Bind("Gid") %>' /><br />
GroupName:
<asp:Label ID="GroupNameLabel" runat="server" Text='<%# Bind("GroupName") %>' /><br />
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Bind("Id") %>' /><br />
GroupDescr:
<asp:Label ID="GroupDescrLabel" runat="server" Text='<%# Bind("GroupDescr") %>' /><br />
<%--ExcludeFromUserFilter: <asp:Label ID="lblExcludefromDocFilter" runat="server" Text='<%# Bind("ExcludeFromUserFilter") %>' /><br />--%>
Members:
<asp:Label ID="MembersLabel" runat="server" Text='<%# Bind("Members") %>' /><br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"
Text="Edit" />
</ItemTemplate>
</asp:FormView>
<asp:Label ID="lblMsg" runat="server" ForeColor="Red" />
<asp:ObjectDataSource ID="PermGroupObjectDataSource1" runat="server" DataObjectTypeName="Accenture.CSTPrague.eAPI.PermGroup"
SelectMethod="FetchPermGroupFromDB" TypeName="Accenture.CSTPrague.eAPI.WebDB_Perm"
UpdateMethod="StorePermGroupToDB" OnUpdating="PermGroupObjectDataSource1_Updating">
<SelectParameters>
<asp:SessionParameter Name="o" SessionField="oPermGroup" Type="Object" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</form>
Set ValidationGroup="xxx" in your validate control and submit button.(don't cancel button")
Try
<asp:RequiredFieldValidator ID="rqrgFldVldtr_GroupName"
ControlToValidate="GroupNameTextBox" **ValidationGroup="xxx"** Display="Dynamic" ErrorMessage="<"
meta:resourcekey="RequiredFieldValidator1Resource2"
runat="server">
</asp:RequiredFieldValidator>
<asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" **ValidationGroup="xxx"** Text="Save"
Width="67px" CssClass="ButtonS1"/>
<asp:Button ID="btnCancel" runat="server" OnClick="btnCancel_Click"
Text="Cancel" CssClass="ButtonS1" CausesValidation="false"/>
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled
Details: Error parsing near <HTML><HEAD><TITLE><
Please help me out , this is bugging me....
<body>
<form id="form1" runat="server">
<aspAtlas:ScriptManager ID="MyScriptManager" runat="server" AllowCustomErrorsRedirect="true">
</aspAtlas:ScriptManager>
<div class="headerborder" id="hd_SubmissionGuidelines">
<aspAtlas:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="t_head">
<asp:HiddenField ID="hfdSizeAttached" runat="server" />
<asp:HiddenField ID="hfdConfidentialDoc" runat="server" />
<asp:HiddenField ID="hfdJustificationDoc" runat="server" />
<asp:HiddenField ID="hfdRedactedVersionDoc" runat="server" />
<asp:Button ID="btnHiddenAttachDoc" runat="server" Style="visibility: hidden" OnClick="btnHiddenAttachDoc_Click" />
<asp:HiddenField ID="hdnDocsAttached" runat="server"></asp:HiddenField>
</td>
</tr>
</table>
</ContentTemplate>
<Triggers>
<aspAtlas:AsyncPostBackTrigger ControlID="btnAgree" EventName="Click" />
<aspAtlas:PostBackTrigger ControlID="btnSubmit" />
<aspAtlas:AsyncPostBackTrigger ControlID="btnBack" EventName="Click" />
<aspAtlas:AsyncPostBackTrigger ControlID="btnHiddenAttachDoc" EventName="Click" />
</Triggers>
</aspAtlas:UpdatePanel>
</div>
<aspAtlas:UpdatePanel ID="UpdPagePanel" runat="server">
<ContentTemplate>
<asp:Panel ID="pnlSubmissionGuidelines" runat="server">
<div class="div_main" id="hd_MainGuidelines">
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="t_guidelines_head">
Doc Submit
</td>
</tr>
<tr>
<td class="t_guidelines_subhead">
Definitions:
</td>
</tr>
<tr>
<td class="t_guidelines_text">
Dummy lines
<br />
<br />
Dummy lines
<br />
<br />
dummy lines
<br />
<br />
dummy lines
</td>
</tr>
<tr>
<td class="t_guidelines_subhead">
dummy lines
</td>
</tr>
<tr>
<td class="t_guidelines_text">
<font style="text-decoration: underline">Process</font>
<br />
<br />
dummy lines
<br />
<br />
dummy lines
<br />
dummy lines
<br />
<br />
<font class="t_guidelines_ul">Trade Secret </font>
<br />
<font class="t_guidelines_ul">Sample </font><br />
<font class="t_guidelines_ul">Sample text</font>
<br />
<br />
dummy lines
<br />
<br />
<font style="text-decoration: underline">Sample text</font>
<br />
<br />
dummy lines
<br />
<br />
<font class="t_guidelines_ul">Sample ddffvdffvdfgvfv
simple text; </font>
<br />
<font class="t_guidelines_ul">simple text; </font>
<br />
<font class="t_guidelines_ul">simple text; </font>
<br />
<font class="t_guidelines_ul">simple text;</font><br />
<font class="t_guidelines_ul">simple text; </font>
<br />
<font class="t_guidelines_ul">and</font><br />
<font class="t_guidelines_ul">simple text.</font><br />
<br />
<br />
<font style="text-decoration: underline">simple text</font>
<br />
<br />
simple text
<br />
<br />
</td>
</tr>
<tr>
<td align="center">
<asp:Button ID="btnAgree" runat="server" CssClass="top_button" OnClick="btnAgree_Click"
Text="I Agree" />
<asp:Button ID="btnDisagree" runat="server" CssClass="top_button" Text="I Disagree"
OnClientClick="javascript:window.close();" />
</td>
</tr>
</table>
</div>
</div>
</asp:Panel>
<asp:Panel ID="pnlConfidentialDocuments" runat="server">
<table width="99%" cellspacing="0" style="border-left: 1px solid #C3C3C3; border-right: 1px solid #C3C3C3;
border-bottom: 1px solid #C3C3C3;" cellpadding="0" align="center" id="Table1">
<tr class="headerborder">
<td class="t_head">
<span id="Conf_Docs_Close" style="cursor: hand" onclick="hideArea('Conf_Docs','Conf_Docs_Close','Conf_Docs_Open')">
-</span><span id="Conf_Docs_Open" onclick="showArea('Conf_Docs','Conf_Docs_Open','Conf_Docs_Close')"
style="cursor: hand; display: none">+</span> Add Confidential Documents
</td>
</tr>
<tr id="Conf_Docs">
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="left" id="Table2">
<tr valign="top">
<td class="astrik">
</td>
<td class="form_field">
<img style="vertical-align: top" alt="Required Field" src="../Images/MandatoryField.gif" />
<asp:Label ID="LblDocType" runat="server"><label for='<%= ddlDocumentType.ClientID %>'>Document Type</label></asp:Label>
</td>
<td class="form_element">
<asp:DropDownList ID="ddlDocumentType" runat="server" CssClass="form_select">
</asp:DropDownList>
<a id="lnkDocumentClassificationHelp" runat="server" onclick="window.open('http://google.com');return false;">
<img src="<% =Request.ApplicationPath %>/images/help_icon.gif" alt='Document Classification Help'
width='16' height='16' /></a>
</td>
<td>
</td>
</tr>
<tr>
<td class="astrik">
</td>
<td class="form_field" style="vertical-align: top">
<img style="vertical-align: top" alt="Required Field" src="../Images/MandatoryField.gif" />
<asp:Label ID="LblDocTitle" runat="server"><label for='<%= txtDocTitle.ClientID %>'>Document Title</label></asp:Label>
</td>
<td class="form_element" colspan="2">
<asp:TextBox ID="txtDocTitle" runat="server" CssClass="textarea_Conf" TextMode="MultiLine"
MaxLength="2000" Rows="10" />
<br />
<asp:Label ID="lblDocTitleLength" runat="server" CssClass="form_label_textareaLength"
Text="Characters remaining: 2000"></asp:Label>
</td>
</tr>
<tr>
<td colspan="4">
<table width="92%" border="0" cellspacing="0" cellpadding="0" align="left" id="Table3">
<tr>
<td class="form_element" align="right">
<asp:Button ID="btnAttachDocs" runat="server" CssClass="top_button" Text="Attach Document"
OnClientClick="javascript:return OpenAttachDocPopup()" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr class="bottomborder">
<td class="toptr">
<asp:Button ID="btnSubmit" Text="Done" CssClass="top_button" runat="server" OnClientClick="javascript:return Validate();"
OnClick="btnSubmit_Click" />
<asp:Button ID="btnBack" Text="Back" CssClass="top_button" runat="server" OnClick="btnBack_Click" />
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="pnlConfidentialDocsGrid" runat="server" Visible="false">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="t_head">
Attached Documents
</td>
</tr>
<tr>
<td>
<asp:DataGrid ID="dgdDocuments" runat="server" Width="100%" OnDeleteCommand="dgdDocuments_Delete"
DataKeyField="DocGuidName" AutoGenerateColumns="false" OnItemDataBound="dgdDocuments_ItemDataBound">
<HeaderStyle CssClass="t_grid_subheadin" />
<ItemStyle CssClass="t_grid_datain" />
<AlternatingItemStyle CssClass="t_grid_datainalt" />
<Columns>
<asp:TemplateColumn ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Image ID="ImgSecurity" runat="server" ToolTip="Confidential" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "SecurityImageDisplay") %>' />
<asp:Label ID="HiddenSecurity" runat="server" Visible="false" Text='<%# DataBinder.Eval(Container.DataItem, "SecurityImageDisplay") %>' />
<asp:HiddenField ID="hfdIsJustification" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "IsJustificationDoc").ToString() %>' />
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn ItemStyle-Width="3" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Image ID="ImgMimeType" runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "MimeTypeImagePath") %>' />
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Document Type" ItemStyle-Width="18%">
<ItemTemplate>
<asp:Label ID="LblType" runat="server" Text='<%# ((WSMatter.IDNameEntity)DataBinder.Eval(Container.DataItem, "DocType")).Name %>'></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Document Title" ItemStyle-Width="50%">
<ItemTemplate>
<asp:Label ID="LblTitle" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "DocTitle") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="File Name" ItemStyle-Width="16%">
<ItemTemplate>
<asp:Label ID="LblName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "DocName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Size" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblSize" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SizetoDisplay") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkDelete" runat="server" CommandName="Delete"><img src="../Images/nok.gif" alt="Delete"/></asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
<asp:HiddenField ID="HdnTotalSizeAttached" runat="server" />
</td>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
<Triggers>
<aspAtlas:AsyncPostBackTrigger ControlID="btnAgree" EventName="Click" />
<aspAtlas:PostBackTrigger ControlID="btnSubmit" />
<aspAtlas:AsyncPostBackTrigger ControlID="btnBack" EventName="Click" />
<aspAtlas:AsyncPostBackTrigger ControlID="btnHiddenAttachDoc" EventName="Click" />
</Triggers>
</aspAtlas:UpdatePanel>
</form>
</body>
As per your code it seems you are not using masterpage, and you have not shown us your tag, so I assume following could help you.
Normally in asp.net webforms, <Head> tag is attributed as
runat="server", So you may try <head runat="server">
Note: I have written it as an answer because there are many comments on the answer, it alerts the moderators. So better new comments get after the answers.
Edit:
This error occurs on the server while processing the response to an asynchronous postback.
There are some links to solve this issue, check it they help:
http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx
http://forums.asp.net/t/1038252.aspx/1/10
ASP.NET Ajax Error: Sys.WebForms.PageRequestManagerParserErrorException