Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Move From asp.net 1.1 to 2.0 gives javascript error on all pages with validators (validation)

1 view
Skip to first unread message

Rob

unread,
Feb 1, 2006, 2:16:07 PM2/1/06
to
I was hoping someone could please please help me out with this issue.
After upgrading to ASP.NET 2.0 all of my pages crash on validation.

In the code below the simple addition of the comparevalidator (or
customvalidator etc) will cause a "Webform_PostBackOptions is
undefined" javascript error after clicking my "Add / Update"
linkbutton.

Removing this line makes the problem go away.
<asp:CompareValidator ControlToValidate="Expiration" Display="Dynamic"
Text="<BR>Error: Invalid Date (mm/dd/yy)" Operator="DataTypeCheck"
Type="Date" Runat="Server"/>

"Add / Update" linkbutton properties
javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("dlstDataList$ctl01$LinkButtonB1", "", true,
"", "", false, true))

Thank you For the Help
RobH...@Yahoo.com


[FULL CODE]

<!-- #include virtual="SharedFiles/includes/header.aspx" -->
<%@ Page language="VB" Debug="true"
SmartNavigation = "False"
AutoEventWireup="False"
validateRequest="false"
%>


<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<%@ Register TagPrefix="CustomControl"
Namespace="ExportTechnologies.WebControls.RTE"
Assembly="ExportTechnologies.WebControls.RTE" %>

<Script Runat="Server">
Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
' *****************************************************
' **** FIRST TIME LOADED ****
' *****************************************************
Set_Default_Filters()
Get_User_Access_Level()
Response.Write("<!-- User Level: " & ViewState("Access_Level") &
"-->")
Select Case ViewState("Access_Level")
Case 0, 1
' Just Show the Preview : No Updates
btnInsert_Top.Visible="False"
btnInsert_Bottom.Visible="False"
Case Else
BindDataList()
End Select
Else
' *****************************************************
' **** PAGE RELOADED ****
' *****************************************************
End If
' *****************************************************
' **** END PAGE LOADED ****
' *****************************************************
End Sub

Sub Set_Default_Filters()
ViewState("Show_UnEnabled") = False
ViewState("Show_Expired") = False
End Sub

Sub Get_User_Access_Level()
Viewstate("Access_Level") = Check_User_Rights()
If Not IsNumeric(ViewState("Access_Level")) Then
Warnings.Text = "[Fault] " & Viewstate("Access_Level")
ViewState("Access_Level") = 1
End If
End Sub

Function Get_Enabled(True_False As String) As String
Select Case True_False
Case "True"
Return "<Font Color=Green>Enabled</Font>"
Case "False"
Return "<Font Color=Red>Disabled</Font>"
End Select
End Function

Function Get_Expired(Expiration) As String
If IsDate(Expiration) Then
If Expiration <= DateTime.Now()
Return "<Font Color=Red>Expired</Font>"
Else
Return "<Font Color=Green>" & Expiration & "</Font>"
End If
End If
End Function

Sub Show_Hide(sender As Object, e As System.EventArgs)
Select Case Sender.Checked
Case True
ViewState("Show_All") = True
Case False
ViewState("Show_All") = False
End Select
BindDataList() ' Which also does loadnews.
End Sub

Function ClientSide_Scripting_Found(Text_To_Search As String) As
Integer
If InStr(1, Text_To_Search, "javascript") Then Return 1
If InStr(1, Text_To_Search, "vbscript") Then Return 1
If InStr(1, Text_To_Search, "onmouse") Then Return 1
If InStr(1, Text_To_Search, "onclick") Then Return 1
Return 0
End Function

Sub LoadNews(Optional Show_UnEnabled as Boolean = False, Optional
Show_Expired as Boolean = False)
Dim tmpControl As Control
tmpControl = LoadControl("SharedFiles/UserControls/NewsInsert.ascx")
CType( tmpControl, NewsInsert ).Show_All = ViewState("Show_All")
plhPlaceHolder.Controls.Add( tmpControl )
End Sub

'***********************************************************
' BIND THE DATA LIST
'***********************************************************
Sub BindDataList
Dim conConnection As SqlConnection
Dim cmdSQL_Select As SqlCommand
Dim dtrDataReader As SqlDataReader
Dim conConnectionString As String =
ConfigurationSettings.AppSettings("GDCIOWebsite_Reader")
Dim SQL_Select As String
Dim What_They_Can_Modify As String

conConnection = New SqlConnection( conConnectionString )
' 1000 = Edit all
' 100 = Edit Only Theirs but can add to all types of news
' <exact #> = Edit only theirs and in the news item specified in user
rights
' 1,0 = ViewOnly
Select Case ViewState("Access_Level")
Case 1000 ' Super Admins (web admin only)
What_They_Can_Modify = " 1 = 1 "
Case Else ' Includes 100 Can Modify ALL section they created.
What_They_Can_Modify = " Owner_StandardID = '" &
Request.ServerVariables("LOGON_USER") & "' "
End Select

' Ordering by the ID DESC is NECESSARY
SQL_Select = "SELECT [ID], [Title], [Body], [footer], [AppliesTo],
IsNull([Priority], 6) as Priority, IsNull([Enabled], 0) as Enabled,
Expiration, [DateTime_Updated], [Owner_StandardID] " & _
"FROM [GDCIO_Website].[dbo].[D_News] " & _
"WHERE " & What_They_Can_Modify & " "

Select Case ViewState("Show_All")
Case False
SQL_Select += "AND Enabled = 1 AND IsNull(Expiration, GetDate() + 2)
>= GetDate() "
Case Else ' True
' Nothing Required Here.
End Select

SQL_Select += "Order By ID DESC "

' SQL_Debug(SQL_Select, 0)
cmdSQL_Select = New SqlCommand( SQL_Select, conConnection)
conConnection.Open()
dtrDataReader = cmdSQL_Select.ExecuteReader()

dlstDataList.DataSource = dtrDataReader
dlstDataList.DataBind()

dtrDataReader.Close()
conConnection.Close()

btnInsert_Top.Visible="True"
btnInsert_Bottom.Visible="True"

LoadNews()
End Sub
'***********************************************************
' END BIND THE DATA LIST
'***********************************************************


Sub Upload_File( e As DataListCommandEventArgs )
Dim strPath as String ' Long Path Location of Web Folder
Dim strShort_Path As String ' Path with out the / for displaying
Dim strFile as String ' Hold location of file then just file Name
Dim strFull_Path As String ' Path + File Name (short)
Dim arraySPLIT() As String ' Split out the path.
Dim strFileLocation As String
Dim DateTime_Updated As String ' Holds the prefix to File Name
(uniqueness)
DateTime_Updated = DateTime.Now().ToString("s")
DateTime_Updated = Replace(Replace(DateTime_Updated, ":", "-"), "/",
"-")

'Upload to same path as script
'Internet Anonymous User must have write permissions

strPath = Server.MapPath(".")
If Right(strPath, 1) <> "\" then
strShort_Path = strPath 'Friendly path name for display
strPath = strPath & "\"
Else
strShort_Path = Left(strPath, Len(strPath) - 1)
End If


'Save as same file name being posted
'The code below resolves the file name
'(removes path info)
Dim tmpInput As HtmlControls.HtmlInputFile
tmpInput = e.Item.FindControl("txtUpload")
strFile = tmpInput.PostedFile.FileName
arraySPLIT = Split(strFile, "\")
strFile = arraySPLIT(UBound(arraySPLIT))
ViewState("File_Name") = strFile
' ** The Path and file name of where to put the files **
strFileLocation = "Uploads\NEWS_" & DateTime_Updated & "_" &
Request.ServerVariables("HTTP_EMAIL") & "_" & strFile
strFull_Path = strPath & strFileLocation

If Len(strFile) > 0 Then ' Make sure they chose something
Dim Warning_Message As String
Try
tmpInput.PostedFile.SaveAs(strFull_Path)
Warning_Message = "Upload of File " & strFile & " Succeeded. You
may now copy and paste image (you may also resize) or hyperlink text to
wherever you wish in the body. When you are finished click the
add/update button to save your changes."
Alert_User(Warning_Message)
Warnings.Text = Warning_Message
ViewState("File_Path") = strFull_Path
ViewState("File_Path_Short") = strFileLocation
Catch Ex as Exception
Warning_Message = "Upload of File " & strFile & " Failed for the
following reason: " & Ex.Message
Alert_User(Warning_Message)
Warnings.Text = Warning_Message
ViewState("File_Path") = "No Attachement"
ViewState("File_Path_Short") = "No Attachement"
Finally

End Try
Else
ViewState("File_Path") = "No Attachement"
ViewState("File_Path_Short") = "No Attachement"
End If
End Sub


'******* EDIT ****************************************
Sub dlstDataList_EditCommand( s As Object, e As
DataListCommandEventArgs )
Dim tmpCheckBox As CheckBox
dlstDataList.EditItemIndex = e.Item.ItemIndex
BindDataList()

btnInsert_Top.Visible="False"
btnInsert_Bottom.Visible="False"
End Sub

'******* CANCEL ****************************************
Sub dlstDataList_CancelCommand( s As Object, e As
DataListCommandEventArgs )
Get_Scalar("[GDCIO_Website].[dbo].[SP_Cancel_NewsInsert]")
dlstDataList.EditItemIndex = -1
BindDataList
End Sub

'******* DELETE ****************************************

Sub dlstDataList_DeleteCommand( s As Object, e As
DataListCommandEventArgs )
Dim conConnection As SqlConnection
Dim strDelete As String
Dim cmdDelete As SqlCommand
Dim strUniqueID As String
Dim conConnectionString As String =
ConfigurationSettings.AppSettings("GDCIOWebsite_Writer")

strUniqueID = dlstDataList.DataKeys( e.Item.ItemIndex )
conConnection = New SqlConnection( conConnectionString )
strDelete = "DELETE FROM [GDCIO_Website].[dbo].[D_News] Where ID=@ID"
cmdDelete = New SqlCommand( strDelete, conConnection )
cmdDelete.Parameters.Add( "@ID", strUniqueID )
conConnection.Open()
cmdDelete.ExecuteNonQuery()
conConnection.Close()
dlstDataList.EditItemIndex = -1
BindDataList
End Sub


'******* INSERT ****************************************
Sub dlstDataList_InsertCommand( s As Object, e As CommandEventArgs)
Dim conConnection As SqlConnection
Dim strInsert As String
Dim cmdInsert As SqlCommand
Dim conConnectionString As String =
ConfigurationSettings.AppSettings("GDCIOWebsite_Writer")

conConnection = New SqlConnection( conConnectionString )
strInsert = "INSERT INTO [GDCIO_Website].[dbo].[D_News] " & _
"(DateTime_Updated, Owner_StandardID, Enabled) " & _
"SELECT GetDate(), '" & Request.ServerVariables("LOGON_USER") &
"', 0"
cmdInsert = New SqlCommand( strInsert, conConnection )
conConnection.Open()
cmdInsert.ExecuteNonQuery()
conConnection.Close()

ViewState("Show_All") = "True"
dlstDataList.EditItemIndex = 0
BindDataList

btnInsert_Top.Visible="False"
btnInsert_Bottom.Visible="False"

End Sub

'******* UPDATE ****************************************
Sub dlstDataList_UpdateCommand( s As Object, e As
DataListCommandEventArgs )
If Page.IsValid() Then
Dim conConnection As SqlConnection
Dim strUpdate As String
Dim cmdUpdate As SqlCommand
Dim conConnectionString As String =
ConfigurationSettings.AppSettings("GDCIOWebsite_Writer")
Dim tmpTextBox As TextBox
Dim tmpCheckBox As CheckBox
Dim tmpCheckBoxList As CheckBoxList
Dim tmpRadioButtonList As RadioButtonList
Dim tmpListItem As ListItem
Dim tmpDropDownList As DropDownList
Dim tmpRichTextBox As RichTextEditor
Dim Body_Text As String
' *** This represents BOTH the Update and the Insert since the
insert is nothing more than
' add blank record then kick off Update.

' Make sure there is no client side scripting in the body
tmpRichTextBox = e.Item.FindControl("body")
If ClientSide_Scripting_Found(tmpRichTextBox.Text) = 0 Then
Upload_File(e)

conConnection = New SqlConnection( conConnectionString )
strUpdate = "UPDATE [GDCIO_Website].[dbo].[D_News] " & _
"Set Title=@Title, Body=@Body, Footer=@Footer, AppliesTo =
@AppliesTo, Enabled=@Enabled, Owner_StandardID = @Owner_StandardID,
Owner_Name = @Owner_Name, Priority = @Priority, Expiration =
@Expiration, DateTime_Updated = GetDate()" & _
"Where ID=@ID"

cmdUpdate = New SqlCommand( strUpdate, conConnection )

'Read in the values of the updated row
cmdUpdate.Parameters.Add(New SQLParameter("@ID",SqlDbType.Int, 8))
cmdUpdate.Parameters("@ID").Value = dlstDataList.DataKeys(
e.Item.ItemIndex )

cmdUpdate.Parameters.Add(New
SQLParameter("@Title",SqlDbType.VarChar))
tmpTextBox = CType(e.Item.FindControl("Title"), TextBox)
cmdUpdate.Parameters("@Title").Value = tmpTextBox.Text

cmdUpdate.Parameters.Add(New
SQLParameter("@Body",SqlDbType.VarChar))
tmpRichTextBox = CType(e.Item.FindControl("Body"), RichTextEditor)
Body_Text = tmpRichTextBox.Text
If ViewState("File_Path_Short") <> "No Attachement" Then
tmpRadioButtonList = e.Item.FindControl("File_Type")
Select Case UCase(Right(ViewState("File_Name"),4))
Case ".BMP", ".JPG", "JPEG", ".GIF"
Body_Text += "<IMG alt='News Image Insert' src='" &
ViewState("File_Path_Short") & "' border=0>"
Case Else
Body_Text += " &nbsp; **** <A href='" &
ViewState("File_Path_Short") & "'>" & ViewState("File_Name") & "</a>
**** &nbsp; "
End Select
End If
' Put the information back so the user can modify.
tmpRichTextBox = e.Item.FindControl("body")
tmpRichTextBox.Text = Body_Text
cmdUpdate.Parameters("@Body").Value = Body_Text

cmdUpdate.Parameters.Add(New
SQLParameter("@Footer",SqlDbType.VarChar))
tmpTextBox = CType(e.Item.FindControl("Footer"), TextBox)
cmdUpdate.Parameters("@Footer").Value = tmpTextBox.Text

Dim AppliesTo_List As String
AppliesTo_List = ""
cmdUpdate.Parameters.Add(New
SQLParameter("@AppliesTo",SqlDbType.VarChar))
tmpCheckBoxList = CType(e.Item.FindControl("AppliesTo"),
CheckBoxList)
For Each tmpListItem In tmpCheckBoxList.Items
If tmpListItem.Selected Then
AppliesTo_List = (tmpListItem.Value & "," & AppliesTo_List)
End If
Next

' Remove the ", " at the End.
If LEN(AppliesTo_List) > 0 Then
AppliesTo_List = Left(AppliesTo_List, (Len(AppliesTo_List) - 1))
cmdUpdate.Parameters("@AppliesTo").Value = AppliesTo_List
Else
cmdUpdate.Parameters("@AppliesTo").Value = System.DBNull.Value
End If

cmdUpdate.Parameters.Add(New SQLParameter("@Enabled",SqlDbType.Bit))

tmpCheckBox = CType(e.Item.FindControl("Enabled"), CheckBox)
cmdUpdate.Parameters("@Enabled").Value = tmpCheckBox.Checked

cmdUpdate.Parameters.Add(New
SQLParameter("@Owner_StandardID",SqlDbType.VarChar))
cmdUpdate.Parameters("@Owner_StandardID").Value =
Request.ServerVariables("LOGON_USER")

cmdUpdate.Parameters.Add(New
SQLParameter("@Owner_Name",SqlDbType.VarChar))
cmdUpdate.Parameters("@Owner_Name").Value =
Request.ServerVariables("HTTP_LAST_NM") & ", " &
Request.ServerVariables("HTTP_FIRST_NM")

cmdUpdate.Parameters.Add(New SQLParameter("@Priority",SqlDbType.Int,
8))
tmpDropDownList = CType(e.Item.FindControl("Priority"),
DropDownList)
cmdUpdate.Parameters("@Priority").Value =
tmpDropDownList.SelectedItem.Value

cmdUpdate.Parameters.Add(New
SQLParameter("@Expiration",SqlDbType.smalldateTime))
tmpTextBox = CType(e.Item.FindControl("Expiration"), TextBox)
If IsDate(tmpTextBox.Text) Then
cmdUpdate.Parameters("@Expiration").Value = tmpTextBox.Text
Else
cmdUpdate.Parameters("@Expiration").Value = System.DBNull.Value
End If


conConnection.Open()
cmdUpdate.ExecuteNonQuery()
conConnection.Close()
If ViewState("File_Path_Short") = "No Attachement" Then
dlstDataList.EditItemIndex = -1
BindDataList()
End If
Warnings.Text = ""
Else ' check for client side scripting
Warnings.Text = "*** Warning ***<BR>Possible client side scripting
was found. This is not allowed.<BR><A
Href=SharedFiles/Help/News_ERROR_ClientSideScripting.wmv><img
src=SharedFiles/Images/Movie.gif border=0>Please view this video on how
to resolve this</a>"
End iF
End If ' Page is Valid.
End Sub


Sub DataList_ItemDataBound(source As Object, e As
DataListItemEventArgs)
Dim tmpCheckBoxList As System.Web.UI.WebControls.CheckBoxList
Dim tmpDropDownList As System.Web.UI.WebControls.DropDownList
Dim tmpLabel As system.Web.UI.WebControls.Label
Dim tmpListItem As System.Web.UI.WebControls.ListItem
Dim tmpRichTextBox As RichTextEditor
Dim tmpImageButton As ImageButton

Select Case e.Item.ItemType
Case ListItemType.Item, ListItemType.AlternatingItem
tmpLabel = e.Item.FindControl("AppliesTo")
If Not e.Item.DataItem("AppliesTo") Is System.DBNull.Value Then
Dim AppliesTo As String()
Dim i As Integer
AppliesTo = Split(e.Item.DataItem("AppliesTo"), ",")
tmpLabel.Text = ""
For i=LBound(AppliesTo) To UBound(AppliesTo)
tmpLabel.Text += "<A Href=SiteMap.Aspx?KeyIDSearch=" &
AppliesTo(i) & ">" & Get_Scalar("SELECT Replace([Title], '*', '') FROM
[GDCIO_Website].[dbo].[D_Navigation] WHERE [ID] = " & AppliesTo(i)) &
"</A><BR>"
Next
End If ' IF the value is empty.

' Create the Delete Confirm
tmpImageButton = e.Item.FindControl("btnDelete")
tmpImageButton.Attributes.Add("onclick","return confirm('** Warning
** " & _
"Deleting this entry will permanently delete it from the list. "
& _
"Please verifiy the item you are deleting, click cancel to cancel
the delete.');")
Case ListItemType.Header
Case ListItemType.Footer
Case ListItemType.EditItem
' ************************************************************
' ***** Where the News Is Inserted And Who Can Modify it *****
' ************************************************************
' 1000 = Edit all
' 100 = Edit Only Theirs but can add to all types of news
' <exact #> = Edit only theirs and in the news item specified in
user rights
' 1,0 = ViewOnly
Dim SQL_Select, What_They_Can_Modify As String
What_They_Can_Modify = " Allows_News_Insert = 1 "
Select Case ViewState("Access_Level")
Case 1000 ' Super Admins (web admin only)
Case 100 ' Admins who can add to all (their own only)
Case Else
What_They_Can_Modify += " AND News_Insert_Access_Level = " &
ViewState("Access_Level")
End Select
SQL_Select = "SELECT [id], [Title] " & _
"FROM [GDCIO_Website].[dbo].[D_Navigation] " & _
"WHERE " & What_They_Can_Modify
'SQL_Debug(SQL_Select, 0)

tmpCheckBoxList = e.Item.FindControl("AppliesTo")
tmpCheckBoxList.DataTextField = "Title"
tmpCheckBoxList.DataValueField = "ID"
tmpCheckBoxList.DataSource = Get_DataSet(SQL_Select)
tmpCheckBoxList.DataBind()

' Loop through all the selections to see if they are already
checked.
If Not e.Item.DataItem("AppliesTo") Is System.DBNull.Value Then
Dim AppliesTo As String()
Dim i As Integer
AppliesTo = Split(e.Item.DataItem("AppliesTo"), ",")
For i=LBound(AppliesTo) To UBound(AppliesTo)
For Each tmpListItem In tmpCheckBoxList.Items
If tmpListItem.Value = AppliesTo(i) Then
tmpListItem.Selected = True
End If
Next
Next
End If ' IF the value is empty.

If e.Item.DataItem("Body") Is System.DBNull.Value Then
tmpRichTextBox = e.Item.FindControl("Body")
tmpRichTextBox.Text = "<Font Color=Red><B>*** Warning
***</B></Font><BR>" & _
"Copying and pasting text with formatting from the web or
office documents is allowed. However, please be careful that you do
not inadvertently copy hidden script calls in this box. If you are
unsure if you have hidden script calls in your copied text, you can
paste it into WORDPAD first then copy the text from wordpad to here.
<BR><Font Color=Blue><Center>*** Delete This Warning Before Continuing
***</Center></Font>"
End If

' Priority
tmpDropDownList = e.Item.FindControl("Priority")
tmpDropDownList.Items.Insert(0, New
System.Web.UI.WebControls.ListItem("On Call Information","0"))
tmpDropDownList.Items.Insert(1, New
System.Web.UI.WebControls.ListItem("Extremely Important","1"))
tmpDropDownList.Items.Insert(2, New
System.Web.UI.WebControls.ListItem("Very Important","2"))
tmpDropDownList.Items.Insert(3, New
System.Web.UI.WebControls.ListItem("Mildly Important","3"))
tmpDropDownList.Items.Insert(4, New
System.Web.UI.WebControls.ListItem("Important","4"))
tmpDropDownList.Items.Insert(5, New
System.Web.UI.WebControls.ListItem("General News","5"))
tmpDropDownList.Items.Insert(6, New
System.Web.UI.WebControls.ListItem("Not Important","6"))
tmpDropDownList.Items.FindByValue(e.Item.DataItem("Priority")).Selected
= True
End Select
End Sub
</Script>

<html>
<head>
<title></title>
</head>
<body>
<form enctype="multipart/form-data" runat="server">
<asp:Label ID="Warnings" CssClass="Warnings_Small" RunAt="Server"/>
<asp:Table Runat="Server"
ID="tblDropDowns"
GridLines="none"
CellPadding="0"
CellSpacing="0"
Width="100%"
CssClass="DarkBackground">
<asp:TableRow Runat="Server">
<asp:TableCell runat="Server" horizontalalign="Left" Width="35%">
<asp:HyperLink RunAt="Server"
ImageUrl="SharedFiles/Images/Movie_Huge.gif"
NavigateUrl="SharedFiles/Help/News.wmv" imageAlign="absbottom"
Text="Play News Help Video" BorderWidth="0"/>
<asp:CheckBox Text="Show Disabled and Expired" Checked="False"
Runat="Server" AutoPostBack="True" OnCheckedChanged="Show_Hide"
CssClass="Headings"/>
</asp:TableCell>
<asp:TableCell runat="Server" horizontalAlign="Left">
<asp:Label Runat="Server" Text="Editable (By You) Content Items "
CssClass="PageTitle"/>
</asp:TableCell>
<asp:TableCell runat="Server" HorizontalAlign="Right"
VerticalAlign="Bottom">
<asp:Button CommandName="Insert" id="btnInsert_Top" runat="server"
onCommand="dlstDataList_InsertCommand" Text="Insert"
CssClass="FormControls"/>
</ASP:TableCell>
</asp:TableRow>
</asp:Table>
<asp:DataList
ID="dlstDataList"
DataKeyField="ID"
OnEditCommand="dlstDataList_EditCommand"
OnCancelCommand="dlstDataList_CancelCommand"
OnDeleteCommand="dlstDataList_DeleteCommand"
OnUpdateCommand="dlstDataList_UpdateCommand"
RepeatRows="99999"
GridLines="Both"
Width="100%"
ItemStyle-CssClass="NonAlternating_Items"
AlternatingItemStyle-CssClass="Alternating_Items"
EditItemStyle-CssClass="FormStyle"
OnItemDataBound="DataList_ItemDataBound"
Runat="Server">
<HeaderTemplate>
<Table Border="0" Cellspacing="0" cellpadding="0" Width="100%"
class="DarkBackGround">
<TR class="Headings">
<TD valign="Top" width="7%" align="Left">
Enabled
</TD>
<TD valign="Top" width="9%" align="Left">
Expiration
</TD>
<TD valign="Top" align="Left">
<asp:Label Text='Title' Runat="Server"/>
</TD>
<TD valign="Top" width="30%" align="Left">
<asp:Label Text='Applies To' Runat="Server"/>
</TD>
<TD valign="Top" width="5%" align="Left">
<asp:Label Text="Modify" Runat="Server"/>
</TD>
</TR>
</Table>
</HeaderTemplate>
<ItemTemplate>
<Table Border="0" Cellspacing="0" cellpadding="0" Width="100%">
<TR>
<TD valign="Top" width="7%" align="Left">
<asp:Label id="Enabled" Text='<%# Get_Enabled(Container.DataItem(
"Enabled")) %>' Runat="Server" CssClass="Items"/>
</TD>
<TD valign="Top" width="9%" align="Left">
<asp:Label id="Expired" Text='<%# Get_Expired(Container.DataItem(
"Expiration")) %>' Runat="Server" CssClass="Items"/>
</TD>
<TD valign="Top" align="Left">
<asp:LinkButton id="Title" Text='<%# Container.DataItem(
"Title")%>' Runat="Server" CssClass="Items" CommandName="edit" />
</TD>
<TD valign="Top" width="30%" align="Left">
<asp:Label id="AppliesTo" Text='<%# Container.DataItem(
"AppliesTo")%>' Runat="Server" CssClass="Items"/>
</TD>
<TD valign="Top" width="5%" >
<asp:ImageButton ID="btnDelete"
ImageUrl="SharedFiles/Images/Trashcan.gif" CommandName="Delete"
ToolTip="Delete Item" RunAt="Server" />
<asp:ImageButton ID="btnEdit"
ImageUrl="SharedFiles/Images/Config.gif" CommandName="edit"
Tooltip="Edit Item" Runat="Server"/>
</TD>
</TR>
</Table>

</ItemTemplate>
<FooterTemplate>

</FooterTemplate>


<EditItemTemplate>

<table class="FormStyle" cellspacing="0" cellpadding="0"
width="100%" border="1">
<tbody>
<tr>
<td width="30%">
<asp:Label runat="Server" text='Title: '
cssclass="FormLabels"/>
</td>
<td width="70%">
<asp:TextBox id="Title" Columns="100" CssClass="FormControls"
Runat="Server" Text='<%# DataBinder.Eval(Container.DataItem,
"Title")%>'/>
</td>
</tr>
<tr>
<td align="Left" valign="Top">
<asp:Label runat="Server" text='Body: '
cssclass="FormLabels"/>
</td>
<td>
<CUSTOMCONTROL:RichTextEditor
ID="Body"
runat="server"
RTEResourcesUrl="SharedFiles/RTE_Resources/"
width="98%"
Align="Center"
height="200"
CssClass="FormControls"
EditorStyle="Olive"
BackGroundColor="#DEE5EF"
HideEditWebPage="True"
HideAbout="True"
Text='<%# DataBinder.Eval(Container.DataItem, "Body")%>'>
</CUSTOMCONTROL:RichTextEditor>
</td>
</tr>
<tr>
<td>
&nbsp;
</td>
<td>
Upload Image or File (You can place the image later).
<BR>
<input id="txtUpload" Size="50" type="file" runat="server"
class="FormControls">
&nbsp;
(Embedded Image or Attached File)

</td>
</tr>
<tr>
<td>
<asp:Label runat="Server" text='Footer: '
cssclass="FormLabels"/>
</td>
<td>
<asp:TextBox id="Footer" Columns="100" CssClass="FormControls"
Runat="Server" Text='<%# DataBinder.Eval(Container.DataItem,
"Footer")%>'/>
</td>
</tr>
<tr>
<td>
<asp:Label runat="Server" text='Applies To: '
cssclass="FormLabels"/>
</td>
<td>
<asp:CheckBoxList ID="AppliesTo" RunAt="Server"/>
</td>
</tr>
<tr>
<tr>
<td>
<asp:Label runat="Server" text='Priority: '
cssclass="FormLabels"/>
</td>
<td>
<asp:DropDownList ID="Priority" RunAt="Server"
CssClass="FormControls"/>
</td>
</tr>
<tr>
<td>
<asp:Label runat="Server" text='Enabled: '
cssclass="FormLabels"/>
</td>
<td>
<asp:CheckBox ID="Enabled" Text="Enabled" RunAt="Server"
Checked='<%# DataBinder.Eval(Container.DataItem, "Enabled")%>'/>
<br>
<asp:Label ID="Enabled_Warning" CssClass="Warnings_Small"
RunAt="Server" Text="* The News Item WILL NOT be active until you Click
The ENABLED checkbox."/>
</td>
</tr>
<tr>
<td>
<asp:Label runat="Server" text='Expiration: '
cssclass="FormLabels"/>
<asp:CompareValidator
ControlToValidate="Expiration" Display="Dynamic" Text="<BR>Error:
Invalid Date (mm/dd/yy)" Operator="DataTypeCheck" Type="Date"
Runat="Server"/>
</td>
<td>
<asp:TextBox ID="Expiration" Text='<%#
DataBinder.Eval(Container.DataItem, "Expiration", "{0:d}")%>'
RunAt="Server" CssClass="FormControls"/>
</td>
</tr>
<tr>
<td colspan="2" class="FormStyle">
&nbsp; <asp:LinkButton id="LinkButtonB1" ForeColor="Blue"
CssClass="Headings" Runat="Server" Text="Add / Update"
CommandName="update" Visible="True"/>
&nbsp;
&nbsp; <asp:LinkButton id="LinkButtonB3"
ForeColor="Blue" CssClass="Headings" Runat="Server" Text="Cancel/Back"
CommandName="cancel" Visible="True"/>
</td>
</tr>
<tr>
<td colspan="2">
&nbsp;
</td>
</tr>
</tbody>
</table>


</EditItemTemplate>
</asp:DataList>
<Table Border="0" Cellspacing="0" cellpadding="0" width="100%">
<TR class="DarkBackground">
<TD align="right" width="10%" valign="top">
<asp:Button CommandName="Insert" id="btnInsert_Bottom"
runat="server" onCommand="dlstDataList_InsertCommand" Text="Insert"
CssClass="FormControls" Visible="True"/>
</TD>
</TR>
</Table>
<br>
<br>
<Table Border="0" Cellspacing="0" cellpadding="0" width="100%">
<TR class="AltHeadings">
<TD>
<asp:Label Runat="Server" Text="Preview (All Owners)"
CssClass="PageTitle"/>
</TD>
</TR>
<TR>
<TD align="right" width="10%" valign="top">
<asp:PlaceHolder id="plhPlaceHolder" runat="Server"/>
</TD>
</TR>
</Table>
</form>
</body>
</html>


************************************************************************************
Control UniqueID Type Render Size Bytes (including children) ViewState
Size Bytes (excluding children) ControlState Size Bytes (excluding
children)
__Page ASP.administration_news_aspx 36351 76 0
ctl06 System.Web.UI.ResourceBasedLiteralControl 958 0 0
ctl07 System.Web.UI.LiteralControl 119 0 0
ctl08 System.Web.UI.LiteralControl 32 0 0
ctl09 System.Web.UI.LiteralControl 29 0 0
ctl10 System.Web.UI.LiteralControl 32 0 0
ctl11 System.Web.UI.LiteralControl 24 0 0
ctl12 System.Web.UI.LiteralControl 19 0 0
ctl13 System.Web.UI.LiteralControl 209 0 0
ctl14 System.Web.UI.ResourceBasedLiteralControl 318 0 0
ctl15 System.Web.UI.LiteralControl 55 0 0
ctl00 System.Web.UI.HtmlControls.HtmlForm 34536 0 0
ctl16 System.Web.UI.LiteralControl 2 0 0
Warnings System.Web.UI.WebControls.Label 50 0 0
ctl17 System.Web.UI.LiteralControl 2 0 0
tblDropDowns System.Web.UI.WebControls.Table 837 0 0
ctl18 System.Web.UI.WebControls.TableRow 689 0 0
ctl19 System.Web.UI.WebControls.TableCell 451 0 0
ctl01 System.Web.UI.WebControls.HyperLink 210 0 0
ctl02 System.Web.UI.WebControls.CheckBox 198 0 0
ctl20 System.Web.UI.WebControls.TableCell 85 0 0
ctl03 System.Web.UI.WebControls.Label 63 0 0
ctl21 System.Web.UI.WebControls.TableCell 138 0 0
btnInsert_Top System.Web.UI.WebControls.Button 99 0
0
ctl22 System.Web.UI.LiteralControl 2 0 0
dlstDataList System.Web.UI.WebControls.DataList 7532 64 0
dlstDataList$ctl00 System.Web.UI.WebControls.DataListItem
513 0 0
dlstDataList$ctl00$ctl03
System.Web.UI.ResourceBasedLiteralControl 296 0 0
dlstDataList$ctl00$ctl00
System.Web.UI.WebControls.Label 18 0 0
dlstDataList$ctl00$ctl04 System.Web.UI.LiteralControl
63 0 0
dlstDataList$ctl00$ctl01
System.Web.UI.WebControls.Label 23 0 0
dlstDataList$ctl00$ctl05 System.Web.UI.LiteralControl
62 0 0
dlstDataList$ctl00$ctl02
System.Web.UI.WebControls.Label 19 0 0
dlstDataList$ctl00$ctl06 System.Web.UI.LiteralControl
32 0 0
dlstDataList$ctl01 System.Web.UI.WebControls.DataListItem
1823 0 0
dlstDataList$ctl01$ctl00 System.Web.UI.LiteralControl
126 0 0
dlstDataList$ctl01$Enabled
System.Web.UI.WebControls.Label 91 64 0
dlstDataList$ctl01$ctl01 System.Web.UI.LiteralControl
62 0 0
dlstDataList$ctl01$Expired
System.Web.UI.WebControls.Label 59 20 0
dlstDataList$ctl01$ctl02 System.Web.UI.LiteralControl
51 0 0
dlstDataList$ctl01$Title
System.Web.UI.WebControls.LinkButton 202 140 0
dlstDataList$ctl01$ctl03 System.Web.UI.LiteralControl
63 0 0
dlstDataList$ctl01$AppliesTo
System.Web.UI.WebControls.Label 551 676 0
dlstDataList$ctl01$ctl04 System.Web.UI.LiteralControl
50 0 0
dlstDataList$ctl01$btnDelete
System.Web.UI.WebControls.ImageButton 359 256 0
dlstDataList$ctl01$ctl05 System.Web.UI.LiteralControl 6
0 0
dlstDataList$ctl01$btnEdit
System.Web.UI.WebControls.ImageButton 168 0 0
dlstDataList$ctl01$ctl06 System.Web.UI.LiteralControl
35 0 0
dlstDataList$ctl02 System.Web.UI.WebControls.DataListItem
1644 0 0
dlstDataList$ctl02$ctl00 System.Web.UI.LiteralControl
126 0 0
dlstDataList$ctl02$Enabled
System.Web.UI.WebControls.Label 91 64 0
dlstDataList$ctl02$ctl01 System.Web.UI.LiteralControl
62 0 0
dlstDataList$ctl02$Expired
System.Web.UI.WebControls.Label 92 64 0
dlstDataList$ctl02$ctl02 System.Web.UI.LiteralControl
51 0 0
dlstDataList$ctl02$Title
System.Web.UI.WebControls.LinkButton 132 44 0
dlstDataList$ctl02$ctl03 System.Web.UI.LiteralControl
63 0 0
dlstDataList$ctl02$AppliesTo
System.Web.UI.WebControls.Label 409 484 0
dlstDataList$ctl02$ctl04 System.Web.UI.LiteralControl
50 0 0
dlstDataList$ctl02$btnDelete
System.Web.UI.WebControls.ImageButton 359 256 0
dlstDataList$ctl02$ctl05 System.Web.UI.LiteralControl 6
0 0
dlstDataList$ctl02$btnEdit
System.Web.UI.WebControls.ImageButton 168 0 0
dlstDataList$ctl02$ctl06 System.Web.UI.LiteralControl
35 0 0
dlstDataList$ctl03 System.Web.UI.WebControls.DataListItem
1706 0 0
dlstDataList$ctl03$ctl00 System.Web.UI.LiteralControl
126 0 0
dlstDataList$ctl03$Enabled
System.Web.UI.WebControls.Label 91 64 0
dlstDataList$ctl03$ctl01 System.Web.UI.LiteralControl
62 0 0
dlstDataList$ctl03$Expired
System.Web.UI.WebControls.Label 59 20 0
dlstDataList$ctl03$ctl02 System.Web.UI.LiteralControl
51 0 0
dlstDataList$ctl03$Title
System.Web.UI.WebControls.LinkButton 143 60 0
dlstDataList$ctl03$ctl03 System.Web.UI.LiteralControl
63 0 0
dlstDataList$ctl03$AppliesTo
System.Web.UI.WebControls.Label 493 596 0
dlstDataList$ctl03$ctl04 System.Web.UI.LiteralControl
50 0 0
dlstDataList$ctl03$btnDelete
System.Web.UI.WebControls.ImageButton 359 256 0
dlstDataList$ctl03$ctl05 System.Web.UI.LiteralControl 6
0 0
dlstDataList$ctl03$btnEdit
System.Web.UI.WebControls.ImageButton 168 0 0
dlstDataList$ctl03$ctl06 System.Web.UI.LiteralControl
35 0 0
dlstDataList$ctl04 System.Web.UI.WebControls.DataListItem
1440 0 0
dlstDataList$ctl04$ctl00 System.Web.UI.LiteralControl
126 0 0
dlstDataList$ctl04$Enabled
System.Web.UI.WebControls.Label 91 64 0
dlstDataList$ctl04$ctl01 System.Web.UI.LiteralControl
62 0 0
dlstDataList$ctl04$Expired
System.Web.UI.WebControls.Label 59 20 0
dlstDataList$ctl04$ctl02 System.Web.UI.LiteralControl
51 0 0
dlstDataList$ctl04$Title
System.Web.UI.WebControls.LinkButton 127 40 0
dlstDataList$ctl04$ctl03 System.Web.UI.LiteralControl
63 0 0
dlstDataList$ctl04$AppliesTo
System.Web.UI.WebControls.Label 243 264 0
dlstDataList$ctl04$ctl04 System.Web.UI.LiteralControl
50 0 0
dlstDataList$ctl04$btnDelete
System.Web.UI.WebControls.ImageButton 359 256 0
dlstDataList$ctl04$ctl05 System.Web.UI.LiteralControl 6
0 0
dlstDataList$ctl04$btnEdit
System.Web.UI.WebControls.ImageButton 168 0 0
dlstDataList$ctl04$ctl06 System.Web.UI.LiteralControl
35 0 0
dlstDataList$ctl05 System.Web.UI.WebControls.DataListItem 5
0 0
dlstDataList$ctl05$ctl00 System.Web.UI.LiteralControl 5
0 0
ctl23 System.Web.UI.LiteralControl 151 0 0
btnInsert_Bottom System.Web.UI.WebControls.Button 105 0 0
ctl24 System.Web.UI.LiteralControl 153 0 0
ctl04 System.Web.UI.WebControls.Label 51 0 0
ctl25 System.Web.UI.LiteralControl 81 0 0
plhPlaceHolder System.Web.UI.WebControls.PlaceHolder 9189 0 0
ctl05 ASP.NewsInsert 9189 0 0
ctl05$ctl00 System.Web.UI.ResourceBasedLiteralControl
958 0 0
ctl05$News System.Web.UI.WebControls.Label 8229 10956 0

ctl05$ctl01 System.Web.UI.LiteralControl 2 0 0
ctl26 System.Web.UI.LiteralControl 34 0 0
ctl27 System.Web.UI.LiteralControl 20 0 0

0 new messages