Here is my effort for using JQuery mobile with asp.net webform. Below is the code I have used in the Default.aspx page. It's a very simple code
Below is the complete code of the aspx page.
<%# Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title> Login</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js">
</script>
</head>
<body>
<form id="form1" runat="server">
<!-- Start of first page -->
<div data-role="page" id="foo">
<div data-role="header">
<h1>Mobile Login</h1>
</div><!-- /header -->
<div data-role="content">
<table width="100%">
<tr width="100%">
<td width="30%" align="right" valign="middle">
<asp:Literal ID="lblUserName" runat="server" Text="User Name"></asp:Literal>
</td>
<td width="50%">
<input type="text" maxlength="20" id="UserName" style="width:50%;" runat="server" />
</td>
</tr>
<tr width="100%">
<td width="50%" align="right">
<asp:Literal ID="Literal1" runat="server" Text="Password"></asp:Literal>
</td>
<td width="50%">
<input type="text" maxlength="20" id="Password" style="width:50%;" runat="server" />
</td>
</tr>
<tr width="100%">
<td width="50%" align="right">
</td>
<td width="50%">
<table width="100%">
<tr>
<td width="30%">
<asp:Button ID="btnLogin" runat="server" Text="Login"
OnClick="btnLogin_Click" />
</td>
<td width="30%">
<asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="ui-btn-active"
OnClick="btnCancel_Click" />
</td>
<td width="40%">
</td>
</tr>
</table>
</td>
</tr>
</table>
</div><!-- /content -->
<div data-role="footer">
<h4>
# All right reserved.
</h4>
</div><!-- /footer -->
</div><!-- /page -->
</form>
</body>
</html>
Now on the server side
protected void btnLogin_Click(object sender, EventArgs e)
{
Response.Redirect("Home.aspx",true);
}
protected void btnCancel_Click(object sender, EventArgs e)
{
UserName.Value = "";
Password.Value = "";
}
but when I am clicking the login/cancel button nothing happen other than the Url is changed from
http://localhost:2278/Mobile/Default.aspx
to
http://localhost:2278/Mobile/Default.aspx#/Mobile/Default.aspx
What is wrong in my code? Can't I access Server side functions from ASP.NET server controls in JQuery Mobile? I am aware that it can be done better in MVC but that's not a option for me in this case.
Please help
This is because .net adds type="submit" to Button control by default. You need to set that to false and I would also set CausesValidation to false too, like this:
<asp:Button ID="btnLogin" runat="server" Text="Login"
OnClick="btnLogin_Click" CausesValidation="False" UseSubmitBehavior="False" />
in all fairness however, I wouldn't have used a server-side event just to navigate away on button click. You can achieve that with much easier way:
Login
..that's, of course, assuming you don't have to do any other server-side operations before navigating away.
Related
Masterpage.aspx
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'>
</script>
<script src="Chrome.js" type="text/javascript"></script>
</head>
<body>
<form id="Master" runat="server">
<table style="width:987px; margin:auto; height: 86px;">
<tr style="background-color:#FFFFFF">
<td class="style2">
<img src="images/logo.jpg" alt="" width="235" height="73" />
</td>
<td style="vertical-align:middle;"class="style1">
<div style="float:right; width:153px; height: 22px;">
<asp:TextBox ID="TextBox1" runat="server" Height="20px"
style="margin-left: 0px" Width="140px">
</asp:TextBox>
</div>
Forget Password? </span></span>
</td>
<td class="style33">
<div style="float:right; width:157px; height: 20px; margin-right: 1px;">
<asp:TextBox ID="TextBox2" runat="server" Height="20px"
style="margin-left: 0px; margin-top:
Width="147px"></asp:TextBox>
</div>
New User Registration </span>
</td>
<td class="style40">
<div style="height: 67px; width: 81px;">
 <asp:Button ID="btnlogin" runat="server" style="color:White; background-color:#404040;font-family:Verdana;font-size:10pt; height: 29px; margin-top: 12px;" Text="Login" onclick="btnlogin_Click1" /></div>
</td>
</tr>
</table>
</td>
</tr>
<tr style="background-color:#207DA8">
<td class="style39">
</td>
<td class="style39">
</td>
</tr>
<script type="text/javascript">
cssdropdown.startchrome("chromemenu")
</script>
</td>
</tr>
<img alt="" src="images/rgt.jpg" style="width: 471px; height: 247px" />
</td>
</tr>
<tr style="vertical-align=top;background-color=#D4D3D9">
<td style="height:1;">
</td>
</tr>
</tbody>
</table>
</tbody>
</table>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</form>
</body>
</html>
RegisterPage.aspx
<%# Page Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="Registration.aspx.cs" ValidateRequest="false" Inherits="Paragraphreader.Registration" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script src="jquery.validate.js" type="text/javascript"></script>
<script src="jquery.validation.js" type="text/javascript"></script>
<script>
$("#Register").submit(function () {
return $(this).validation();
alert("submitted");
});
</script>
<script>
function validate() {
var a = 0, rdbtn = document.getElementsByName("gender");
for (i = 0; i < rdbtn.length; i++) {
if (rdbtn.item(i).checked == false) {
a++;
}
}
if (a == rdbtn.length) {
document.getElementById("RadioButtonList1").style.border = "2px solid red";
return false;
} else {
document.getElementById("RadioButtonList1").style.border = "";
return true;
}
}
</script>
<link href="Career.css" rel="stylesheet" type="text/css" />
<link href="Chrome.css" rel="stylesheet" type="text/css" />
<link href="Styles.css" rel="stylesheet" type="text/css" />
<form id="Register" runat="server">//A page can have only one form tag
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="FormUpdatePanel" runat="server">
<ContentTemplate>
I am getting error(A page can have only one server side cof while compiling RegisterPage.aspx.In the master page i have a form tag and server side code
In the Register page i have a form tag and server side code.how to avoid this error
Master pages should not contain form tags in general because they are meant to be used only as the base layout of your content page. Remove the form tag from the Master page and the error will go away.
If you want to define a common "Login" section for all your pages (this appears to be your intent), you can instead create a UserControl to do this. You would then define a section inside your Master page to contain this user control making sure that the ContentPlaceHolder of the Login UserControl always ends up enclosed inside the content page's form. That way, when you submit the form, the btnlogin_Click1 click event is triggered.
In conclusion: re-arrange your page in a way that you have one form tag per page, since ASP.NET does not allow having more than one and try to define your form's inside the content pages and not the Master page.
I have a repeater. i want to get empid when i click on its any row.? how can i ?
My code is:-
<table id="table1" class="yui" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>
Emp name #
</th>
<th>
emp sal
</th>
<th>
emp address
</th>
</tr>
</thead>
<tbody>
<asp:Repeater ID="Repaddressorbbl" runat="server" OnItemCommand="Repaddressorbbl_ItemCommand">
<ItemTemplate>
<tr id="gh" style="cursor: pointer" onclick="Select(this);">
<td style="text-align: center;">
<%#Eval("empname")%>
</td>
<td style="text-align: center;">
<%# Eval("empsal")%>
</td>
<td style="text-align: center;">
<%# Eval("empadd")%>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</tbody>
<tfoot>
<tr id="pagerOne1">
<td colspan="4">
<img src="_assets/img/first.png" class="first" />
<img src="_assets/img/prev.png" class="prev" />
<input type="text" class="pagedisplay" />
<img src="_assets/img/next.png" class="next" />
<img src="_assets/img/last.png" class="last" />
<select class="pagesize">
<option selected="selected" value="100">100</option>
<option value="200">200</option>
<option value="400">400</option>
</select>
</td>
</tr>
</tfoot>
</table>
YOu have to create manual postback. But for this to work always, your repeater should bind always, i.e. during each postback.
The following code snippets may guide you.
using System;
namespace PostbackRef.Web
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
string arg = Request["__EVENTARGUMENT"];
if (string.IsNullOrEmpty(arg) == false)
{
if (arg.StartsWith("row"))
{
string v = arg.Substring(arg.IndexOf("#") + 1);
txtSelected.Text = v;
}
}
}
//Have to bind repeater always
Repeater1.DataBind();
}
protected string getPostbackReference(string Name)
{
return ClientScript.GetPostBackEventReference(this, "rowEvent#" + Name);
}
}
}
The aspx markup looks like this:
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="PostbackRef.Web._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
p
{
font-size: 12pt;
}
p:hover
{
background-color: Gray;
font-weight: bold;
color: White;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="ObjectDataSource1">
<ItemTemplate>
<p onclick="<%# getPostbackReference((string)Container.DataItem) %>">
<%# Container.DataItem %></p>
</ItemTemplate>
</asp:Repeater>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetNames"
TypeName="PostbackRef.Web.MyDs"></asp:ObjectDataSource>
<asp:HiddenField ID="hfValue" runat="server" />
</div>
<div>
Clicked :
<asp:TextBox ID="txtSelected" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
I've used an ObjectDataSource which returns a string array of names, but the choice of datasource is entirely yours. Here I've used just for e.g. sake.
Note that I am calling Repeater1.Databind() on Page_Load irrespective of postback or not. There are probably better ways to do this. But most of the code came exactly here
Here the sample with checkbox control. Same way you gonna use with button or any click events. Make it one hidden for empid.
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
CheckBox box = sender as CheckBox;
RepeaterItem item = box.NamingContainer as RepeaterItem;
HiddenField hf = item.FindControl("HiddenField1") as HiddenField;string id = hf.Value;
}
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged" />
<asp:HiddenField ID="HiddenField1" Value='<%# Eval("id") %>' runat="server" />
</ItemTemplate>
a quick write -up
<asp:Repeater ID="Repaddressorbbl" runat="server" OnItemCommand="Repaddressorbbl_ItemCommand">
<ItemTemplate>
<tr id="gh" style="cursor: pointer" onclick="Select('<%# Eval("EmployeeID")%>');">
<td style="text-align: center;">
<%#Eval("empname")%>
</td>
<td style="text-align: center;">
<%# Eval("empsal")%>
</td>
<td style="text-align: center;">
<%# Eval("empadd")%>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
try this one
I find that the Sharepoint asp.net dropdown menus aren't following the styles that they should in every browser except IE7.
In the image above you see that the button text is displayed below the button icon instead of next to it; The odd thing is, the same menu viewed from a different page will display correctly.
I've looked through the master page code and can't figure out what would cause this, any pointers would be welcome.
The entire masterpage code is below here if anyone is willing to read all of that :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%#Master language="C#"%>
<%# Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%# Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%# Import Namespace="Microsoft.SharePoint" %>
<%# Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%# Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%# Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
<%# Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %>
<%# Register TagPrefix="SPIntranet" TagName="Ticker" Src="~/_controltemplates/SPIntranetTicker.ascx" %>
<%# Register TagPrefix="SPIntranet" TagName="Banner" Src="~/_controltemplates/SPIntranetBanner.ascx" %>
<HTML dir="<%$Resources:wss,multipages_direction_dir_value%>" runat="server" xmlns:o="urn:schemas-microsoft-com:office:office" __expr-val-dir="ltr">
<HEAD runat="server">
<META Name="GENERATOR" Content="Microsoft SharePoint">
<META Name="progid" Content="SharePoint.WebPartPage.Document">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META HTTP-EQUIV="Expires" content="0">
<SharePoint:RobotsMetaTag runat="server"/>
<Title ID=onetidTitle><asp:ContentPlaceHolder id=PlaceHolderPageTitle runat="server"/></Title>
<SharePoint:ScriptLink language="javascript" name="core.js" Defer="true" runat="server"/>
<SharePoint:CustomJSUrl runat="server"/>
<SharePoint:SoapDiscoveryLink runat="server"/>
<SharePoint:CssLink runat="server"/>
<SharePoint:Theme runat="server"/>
<!-- SPECIFY STYLE SHEET -->
<link rel="stylesheet" type="text/css" href="/Style Library/Custom CSS/OlympicIntranet.css" />
<!-- <style>
#mp1_0_8_Anchor{
display:inline-block;
}
#zz10_ID_PersonalizePage{
margin-left:60px;
}
</style>-->
<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server">
</asp:ContentPlaceHolder>
<SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>
</HEAD>
<BODY scroll="yes" onload="javascript:if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">
<form class="body" runat="server" onsubmit="return _spFormOnSubmitWrapper();"><asp:ScriptManager ID="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" />
<WebPartPages:SPWebPartManager id="m" runat="Server"/>
<table class="divMainContainer" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<!-- Site Logo -->
<td>
<table width="100%"cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="divOlympicLogo">
<a href="\">
<span>
<SharePoint:SiteLogoImage id="onetidHeadbnnr0" LogoImageUrl="/_layouts/images/titlegraphic.gif" runat="server"/>
</span>
</a>
</td>
<!-- Quick Link Spacer -->
<td class="divOlympicTopQuickLinkCorner">
<span></span>
</td>
<!-- Quick Links -->
<td class="divQuickLink">
<a id="aBrainDump" href="https://www.braindump.co.nz/olympic" class="icon"><span>
<img src="/images/brain_dump_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="aCRM" href="http://crm/" class="icon"><span>
<img src="/images/crm_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="aexp" href="http://intranet/expenseclaim/" class="icon"><span>
<img src="/images/expense_claim_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="aGoAdmin" href="http://goadmin/" class="icon"><span>
<img src="/images/go_admin_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="aLeave" href="http://intranet/Default.aspx?tabid=668" class="icon"><span>
<img src="/images/leave_request_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="aReport" href="http://intranet/Default.aspx?tabid=588" class="icon"><span>
<img src="/images/report_centre_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="aTimeSheet" href="http://intranet/goweb/ielogin.htm" class="icon"><span>
<img src="/images/time_sheet_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="aTFS" href="http://tfs" class="icon"><span>
<img src="/images/tfs_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="awiki" href="http://wikione/Wiki%20Pages/Home.aspx" class="icon"><span>
<img src="/images/wikione_icon.png" class="imgIcon"></img>
</span></a>
</td >
</tr>
</table>
</td>
</tr>
<tr>
<asp:ContentPlaceHolder ID="WSSDesignConsole" runat="server">
<wssuc:DesignModeConsole id="IdDesignModeConsole" runat="server"/>
</asp:ContentPlaceHolder>
<!-- Publishing console control -->
<asp:ContentPlaceHolder ID="SPNavigation" runat="server">
<td>
<SharePoint:DelegateControl runat="server" ControlId="PublishingConsole"
PrefixHtml="<tr><td colspan="4" id="mpdmconsole" class="ms-consolemptablerow">"
SuffixHtml="</td></tr>"></SharePoint:DelegateControl>
</td>
</asp:ContentPlaceHolder>
</tr>
<tr>
<td style="padding-bottom:5px;">
<!-- Tabs Menu -->
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="divOlympicTabLeft" align="left">
<SharePoint:AspMenu
ID="TopNavigationMenu"
Runat="server"
DataSourceID="topSiteMap"
EnableViewState="false"
AccessKey="<%$Resources:wss,navigation_accesskey%>"
Orientation="Horizontal"
StaticDisplayLevels="2"
MaximumDynamicDisplayLevels="1"
DynamicHorizontalOffset="0"
StaticPopoutImageUrl="/_layouts/images/menudark.gif"
StaticPopoutImageTextFormatString=""
DynamicHoverStyle-BackColor="#CBE3F0"
SkipLinkText=""
StaticSubMenuIndent="0"
CssClass="ms-topNavContainer"><StaticMenuStyle/><StaticMenuItemStyle CssClass="ms-topnav" ItemSpacing="0px"/><StaticSelectedStyle CssClass="ms-topnavselected" /><StaticHoverStyle CssClass="ms-topNavHover" /><DynamicMenuStyle BackColor="#F2F3F4" BorderColor="#A7B4CE" BorderWidth="1px"/><DynamicMenuItemStyle CssClass="ms-topNavFlyOuts"/><DynamicHoverStyle CssClass="ms-topNavFlyOutsHover"/><DynamicSelectedStyle CssClass="ms-topNavFlyOutsSelected"/></SharePoint:AspMenu>
<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource"><Template_Controls>
<asp:SiteMapDataSource
ShowStartingNode="False"
SiteMapProvider="SPNavigationProvider"
id="topSiteMap"
runat="server"
StartingNodeUrl="sid:1002"/>
</Template_Controls></SharePoint:DelegateControl>
</td>
<td>
</td>
<td class="IntranetSiteAction" align="right">
<SharePoint:SiteActions runat="server" id="SiteActionsMenuMain"
PrefixHtml="<div><div>"
SuffixHtml="</div></div>"
MenuNotVisibleHtml=" "><CustomTemplate>
<SharePoint:FeatureMenuTemplate runat="server" FeatureScope="Site" Location="Microsoft.SharePoint.StandardMenu" GroupId="SiteActions" UseShortId="true">
<SharePoint:MenuItemTemplate runat="server" id="MenuItem_Create" Text="<%$Resources:wss,viewlsts_pagetitle_create%>" Description="<%$Resources:wss,siteactions_createdescription%>" ImageUrl="/_layouts/images/Actionscreate.gif" MenuGroupId="100" Sequence="100" UseShortId="true" ClientOnClickNavigateUrl="~site/_layouts/create.aspx" PermissionsString="ManageLists, ManageSubwebs" PermissionMode="Any" />
<SharePoint:MenuItemTemplate runat="server" id="MenuItem_EditPage" Text="<%$Resources:wss,siteactions_editpage%>" Description="<%$Resources:wss,siteactions_editpagedescription%>" ImageUrl="/_layouts/images/ActionsEditPage.gif" MenuGroupId="100" Sequence="200" ClientOnClickNavigateUrl="javascript:MSOLayout_ChangeLayoutMode(false);" />
<SharePoint:MenuItemTemplate runat="server" id="MenuItem_Settings" Text="<%$Resources:wss,settings_pagetitle%>" Description="<%$Resources:wss,siteactions_sitesettingsdescription%>" ImageUrl="/_layouts/images/ActionsSettings.gif" MenuGroupId="100" Sequence="300" UseShortId="true" ClientOnClickNavigateUrl="~site/_layouts/settings.aspx" PermissionsString="EnumeratePermissions,ManageWeb,ManageSubwebs,AddAndCustomizePages,ApplyThemeAndBorder,ManageAlerts,ManageLists,ViewUsageData" PermissionMode="Any" />
</SharePoint:FeatureMenuTemplate>
</CustomTemplate></SharePoint:SiteActions>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" width="100%" class="style1">
<SPIntranet:Banner id="Banner" runat="server"></SPIntranet:Banner >
</td>
</tr>
<tr>
<td class="tickerBackground">
<table width="100%" style="padding-left:10px; vertical-align:top;" cellpadding="0" cellspacing="0">
<tr>
<td align="left">
<img src="/images/whats_today_hdr.png" style="background-color:transparent; vertical-align:bottom;"></img>
</td>
<td style="max-width:300px;padding-left:0px;" valign="middle">
<script src="http://sp2010dev:90/Style Library/jquery/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="http://sp2010dev:90/Style Library/jquery/jquery.marquee.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('marquee').marquee();
});
</script>
<marquee style="width:310px;margin-left:0px;" scrollamount="1">test</marquee>
<!--<SPIntranet:Ticker id="Ticker" runat="server"></SPIntranet:Ticker>-->
</td>
<td class="tickerSearchDivider" style="width:25px;">
<span></span>
</td>
<td class="powerSearchHeading" style="background-color:transparent;">
<img src="/images/power_search_hdr.png" style="background-color:transparent;"></img>
</td>
<td class="searchBackGround" align="right" padding-left="5px">
<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox"/>
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
</td>
</tr>
<tr style="background-color:#FFFFFF">
<td>
<table width="100%;" height="10px;">
<tr>
<td>
<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server">
<asp:SiteMapPath SiteMapProvider="SPContentMapProvider" id="ContentMap" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/>
</asp:ContentPlaceHolder>
</td>
<td>
<!--- --- --- Top Toolbar --- --- --->
<!-- Global nav, including breadcrumbs and global links -->
<asp:ContentPlaceHolder id="PlaceHolderGlobalNavigation" runat="server">
<span id="TurnOnAccessibility" style="display:none">
<a href="#" class="ms-skip" onclick="SetIsAccessibilityFeatureEnabled(true);UpdateAccessibilityUI();return false;">
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,master_turnonaccessibility%>" EncodeMethod="HtmlEncode"/></a>
</span>
<A href="javascript:;" onclick="javascript:this.href='#mainContent';" class="ms-skip" AccessKey="<%$Resources:wss,maincontent_accesskey%>" runat="server">
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,mainContentLink%>" EncodeMethod="HtmlEncode"/></A>
<span id="TurnOffAccessibility" style="display:none">
<a href="#" class="ms-acclink" onclick="SetIsAccessibilityFeatureEnabled(false);UpdateAccessibilityUI();return false;">
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,master_turnoffaccessibility%>" EncodeMethod="HtmlEncode"/></a>
</span>
<!-- Global Breadcrumb -->
</asp:ContentPlaceHolder>
</td>
<td align="right" >
<!-- Welcome Message-->
<table cellpadding="0" cellspacing="0" height=100% class="ms-globalright" style="background-color:#FFFFFF">
<tr>
<td valign="middle" class="ms-globallinks" style="padding-left:3px; padding-right:6px;">
<SharePoint:DelegateControl runat="server" ControlId="GlobalSiteLink0"/>
</td>
<td valign="middle" class="ms-globallinks">
<wssuc:Welcome id="IdWelcome" runat="server" EnableViewState="false">
</wssuc:Welcome>
</td>
<td style="padding-left:1px;padding-right:3px;" class="ms-globallinks">|</td>
<td valign="middle" class="ms-globallinks">
<table cellspacing="0" cellpadding="0">
<tr>
<td class="ms-globallinks">
<SharePoint:DelegateControl ControlId="GlobalSiteLink1" Scope="Farm" runat="server"/></td>
<td class="ms-globallinks">
<SharePoint:DelegateControl ControlId="GlobalSiteLink2" Scope="Farm" runat="server"/></td>
</tr>
</table>
</td>
<td valign="middle" class="ms-globallinks">
<img align='absmiddle' border=0 src="/_layouts/images/helpicon.gif" alt="<%$Resources:wss,multipages_helplinkalt_text%>" runat="server">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table id="MainContentsTable" class="mainContentsTable" width="100%">
<tr>
<td class="mainTableLeftColumn">
<!--- --- --- Left Navigation Bar --- --- --->
<!-- Left Nav bar data source -->
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBarDataSource" runat="server" />
<!-- Area above left nav bar; Used to place profile pic for My Site -->
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBarTop" runat="server"/>
<!-- Calendar date picker -->
<asp:ContentPlaceHolder id="PlaceHolderCalendarNavigator" runat="server" />
<!-- Quick Launch -->
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server">
<!-- View All Site Content -->
<label class="ms-hidden">
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,quiklnch_pagetitle%>" EncodeMethod="HtmlEncode"/></label>
<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ViewFormPages"><SharePoint:SPLinkButton id="idNavLinkViewAll" runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" Text="<%$Resources:wss,quiklnch_allcontent%>" AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>"/></SharePoint:SPSecurityTrimmedControl>
<!-- Quick Launch Items -->
<Sharepoint:SPNavigationManager
id="QuickLaunchNavigationManager"
runat="server"
QuickLaunchControlId="QuickLaunchMenu"
ContainedControl="QuickLaunch"
EnableViewState="false"><SharePoint:DelegateControl runat="server" ControlId="QuickLaunchDataSource"><Template_Controls>
<asp:SiteMapDataSource SiteMapProvider="SPNavigationProvider" ShowStartingNode="False" id="QuickLaunchSiteMap" StartingNodeUrl="sid:1025" runat="server" />
</Template_Controls>
</SharePoint:DelegateControl><SharePoint:AspMenu id="QuickLaunchMenu" DataSourceId="QuickLaunchSiteMap" runat="server" Orientation="Vertical" StaticDisplayLevels="2" ItemWrap="true" MaximumDynamicDisplayLevels="0" StaticSubMenuIndent="0" SkipLinkText=""><LevelMenuItemStyles><asp:menuitemstyle CssClass="ms-navheader" /><asp:menuitemstyle CssClass="ms-navitem" />
</LevelMenuItemStyles><LevelSubMenuStyles><asp:submenustyle CssClass="ms-navSubMenu1" /><asp:submenustyle CssClass="ms-navSubMenu2" />
</LevelSubMenuStyles><LevelSelectedStyles><asp:menuitemstyle CssClass="ms-selectednavheader" /><asp:menuitemstyle CssClass="ms-selectednav" />
</LevelSelectedStyles>
</SharePoint:AspMenu></Sharepoint:SPNavigationManager>
<!--- Tree View --->
<Sharepoint:SPNavigationManager
id="TreeViewNavigationManager"
runat="server"
ContainedControl="TreeView">
<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" id="idNavLinkSiteHierarchy" Text="<%$Resources:wss,treeview_header%>" AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>" />
<SharePoint:SPHierarchyDataSourceControl runat="server" id="TreeViewDataSource" RootContextObject="Web" IncludeDiscussionFolders="true" />
<SharePoint:SPRememberScroll runat="server" id="TreeViewRememberScroll" onscroll="javascript:_spRecordScrollPositions(this);" Style="overflow: auto;height: 400px;width: 150px; ">
<SharePoint:SPTreeView id="WebTreeView" runat="server" ShowLines="false" DataSourceId="TreeViewDataSource" ExpandDepth="0" SelectedNodeStyle-CssClass="ms-tvselected" NodeStyle-CssClass="ms-navitem" NodeStyle-HorizontalPadding="2" SkipLinkText="" NodeIndent="12" ExpandImageUrl="/_layouts/images/tvplus.gif" CollapseImageUrl="/_layouts/images/tvminus.gif" NoExpandImageUrl="/_layouts/images/tvblank.gif">
</SharePoint:SPTreeView>
</SharePoint:SPRememberScroll>
</Sharepoint:SPNavigationManager>
<!-- Recycle Bin -->
<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/_layouts/recyclebin.aspx" id="idNavLinkRecycleBin" ImageUrl="/_layouts/images/recycbin.gif" Text="<%$Resources:wss,StsDefault_RecycleBin%>" PermissionsString="DeleteListItems"/>
</asp:ContentPlaceHolder>
<!-- Left nav Actions area -->
<asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat="server"/>
<!--- --- --- End of Left Navigation Bar --- --- --->
</td>
<td class="mainTableMiddleColumn">
<!--- --- --- Page Content --- --- --->
<!-- In the wrapper DIV, the ID "MSO_ContentDiv" places the Web Part Tool Pane directly to the right of the content area -->
<div id="MSO_ContentDiv" runat="server">
<A name="mainContent"></A>
<!-- Page Description -->
<asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat="server"/>
<!-- Main content area -->
<asp:ContentPlaceHolder id="PlaceHolderMain" runat="server">
</asp:ContentPlaceHolder>
</div>
<!--- --- --- End of Page Content --- --- --->
</td>
<td class="mainTableRightColumn">
<asp:ContentPlaceHolder id="PlaceHolderRight" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="footer" class="footer">
</td>
</tr>
<tr>
<td id="padding" height="100%">
</td>
</tr>
</table>
<input type="text" name="__spDummyText1" style="display:none;" size=1/>
<input type="text" name="__spDummyText2" style="display:none;" size=1/>
</form>
<!--- --- --- Leave the following placeholders beneath all page content --- --- --->
<!-- Footer -->
<asp:ContentPlaceHolder id="PlaceHolderUtilityContent" runat="server"/>
<!-- Used to add body styles to the page header -->
<asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat="server"/>
<!-- Used to add styles to the page header -->
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat="server"/>
</div>
<!--- --- --- Hidden Placeholders --- --- --->
<asp:Panel visible="false" runat="server" BackColor="White">
<!-- PLACE UNUSED CONTENT PLACEHOLDERS HERE -->
<asp:ContentPlaceHolder id="PlaceHolderSiteName" runat="server">
<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/" id="onetidProjectPropertyTitle">
<SharePoint:ProjectProperty Property="Title" runat="server" />
</SharePoint:SPLinkButton>
</asp:ContentPlaceHolder>
<!--- --- --- Horizontal Top Navigation Bar --- --- --->
<!-- Container for top bar -->
<asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">
<!-- Top bar-->
<asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server">
</asp:ContentPlaceHolder>
<!-- Site Actions Menu -->
</asp:ContentPlaceHolder>
<!--- --- --- End of Horizontal Top Navigation Bar --- --- --->
<!--- --- --- Edit Consoles --- --- --->
<!-- Edit console that appears in page Edit mode -->
<!--- --- --- End of Edit Consoles --- --- --->
<!--- --- --- Page Header --- --- --->
<!-- Page Image -->
<asp:ContentPlaceHolder id="PlaceHolderPageImage" runat="server"/>
<!--- Breadcrumb nav on sub pages --->
<!--- Page Title -->
<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" />
<!-- Mini Console - provides page level commands such as the supplementary buttons for Site Map -->
<asp:ContentPlaceHolder id="PlaceHolderMiniConsole" runat="server"/>
<!--- --- --- End of Page Header --- --- --->
<!-- Form Digest Security Control -->
<asp:ContentPlaceHolder id="PlaceHolderFormDigest" runat="server">
<SharePoint:FormDigest runat="server" />
</asp:ContentPlaceHolder>
<!--- --- Placeholders used in default.master that you will likely not use --- --->
<!-- Area between page image and page title -->
<asp:ContentPlaceHolder id="PlaceHolderTitleLeftBorder" runat="server"/>
<!-- Area between page name and right page border -->
<asp:ContentPlaceHolder id="PlaceHolderTitleRightMargin" runat="server"/>
<!-- Area between top nav bar and page content -->
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaSeparator" runat="server"/>
<!-- Sets a width of the left nav bar -->
<asp:ContentPlaceHolder id="PlaceHolderNavSpacer" runat="server"><IMG SRC="/_layouts/images/blank.gif" width=138 height=1 alt=""></asp:ContentPlaceholder>
<!-- Area between left nav bar and page content -->
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBarBorder" runat="server"></asp:ContentPlaceHolder>
<!-- Area between left nav and content -->
<asp:ContentPlaceHolder id="PlaceHolderBodyLeftBorder" runat="server"/>
<!-- Area between content and right page border -->
<asp:ContentPlaceHolder id="PlaceHolderBodyRightMargin" runat="server"/>
<!-- Title -->
<asp:ContentPlaceHolder id="PlaceHolderGlobalNavigationSiteMap" runat="server">
<asp:SiteMapPath SiteMapProvider="SPSiteMapProvider" id="GlobalNavigationSiteMap" RenderCurrentNodeAsLink="true" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/>
</asp:ContentPlaceHolder>
<!-- Help Icon -->
</asp:Panel>
<!--- --- --- End of Hidden Placeholders --- --- --->
</BODY>
</HTML>
I've done everything. Deleted the code and dragged new controls from the toolbox, renamed, tried from javascript -- I just can't get this freakin' modalpopupextender to show. Wasted 3 days.
I'm trying to show it via VB code-behind in the on-click even of the login button. Everything else executes in the button's code, just not this line:
Me.ModalPopupExtender2.Show()
But no matter what I try, it likes to stay hidden.
Any ideas would be welcome!!! Thanks,
Jason
PS -- here's the aspx coding
<%# Page Language="vb" AutoEventWireup="false" CodeBehind="Login.aspx.vb" Inherits="LetterWriterASP.Login" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head id="Head2"><meta http-equiv="Expires" content="-1" /><title>
Anchor General Insurance Agency, Inc.
</title><meta http-equiv="Expires" content="-1" /><link rel="shortcut icon" href="Images/favicon.ico" /><link href="App_Themes/Default/Calendar.css" type="text/css" rel="stylesheet" /><link href="App_Themes/Default/Default.css" type="text/css" rel="stylesheet" />
</head>
<style type="text/css">
.ModalPopupBG
{
background-color: #666699;
filter: alpha(opacity=50);
opacity: 0.7;
}
.HellowWorldPopup
{
min-width:200px;
min-height:100px;
background:white;
border-color:Silver;
border-style:ridge;
border-width:medium;
}
.HeaderStyle
{
color:Black;
background-color:Black;
border-style:solid;
}
.PopupHeader
{
color:Black;
background-color: Black;
}
</style>
<body leftmargin="0" topmargin="0"
background="Images/tile-grey-stripe.jpg">
<form id="Form1" runat="server">
<table width="1000" height="99" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="35" background="../Images/a_ag01.jpg"></td>
<td width="524"><img src="Images/a_ag1.jpg" alt="" width="524" height="99" border="0" align="top" /></td>
<td width="389">
<table border="0" cellspacing="0" cellpadding="0" width="389">
<tr>
<td width="218"><img id="imgHeader" src="Images/text_title_producer1.jpg" style="height:99px;width:218px;border-width:0px;" /></td>
<td width="111"><img id="imgHeadr2" src="Images/text_title-TILE.jpg" style="height:99px;width:171px;border-width:0px;" /></td>
</tr>
</table>
</td>
<td width="19" align="right"><img src="Images/a_ag4_end.jpg" width="19" height="99" alt="" /></td>
<td align="right" width="33" background="Images/a_ag5.jpg"></td>
</tr>
</table>
<!--end of the header table -->
<table height="702" width="1000" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="50" background="Images/b_ag1_lefttile.jpg"> <!-- This is the left wall of the form !-->
</td>
<td width="900" valign="top" bgcolor="#FFFFFF">
<!-- Text, controls, buttons, etc goes below this comment. !-->
<script type="text/javascript">
function InvalidLogin()
{
alert("Invalid user name or password. Please try again.");
window.location = "../Login.aspx";
}
function ShowModal()
{$find('ModalPopupExtender2').show();}
</script>
<br /><br /><br /><br /><br /><br /><br />
<center><table border="2" cellpadding="4" cellspacing="0"
style="border-collapse:collapse;">
<tr>
<td>
<table border="0" cellpadding="0" style="height:172px;width:278px;">
<tr>
<td align="center" colspan="2"
style="color:White;background-color:#5D7B9D;font-size:0.9em;font-weight:bold;">
Log In</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User
Name:</asp:Label>
</td>
<td>
<asp:TextBox ID="UserName" Width="150" name="UserName" runat="server" Font-Size="0.8em"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server"
ControlToValidate="UserName" ErrorMessage="User Name is required."
ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
</td>
<td>
<asp:TextBox ID="Password" Width="150" runat="server" Font-Size="0.8em" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server"
ControlToValidate="Password" ErrorMessage="Password is required."
ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2" style="color:Red;">
<asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<asp:Button ID="LoginButton" runat="server" BackColor="#FFFBFF"
BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" CommandName="Login"
Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284775"
onclick="LoginButton_Click1" Text="Log In" ValidationGroup="Login1" />
</td>
</tr>
</table>
</td>
</tr>
</table> </center>
<!-- Text, controls, buttons, etc goes above this comment. !-->
<!--"#E6E2D8" "Black"-->
</td>
<td width="50" background="Images/b_ag1_righttile.jpg"> <!-- This is the right wall !-->
</td>
</tr>
</table>
<!--end of content table -->
<table height="75" width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="80" background="Images/c_ag1_leftcorner.jpg"></td>
<td width="840" align="center" valign="top" background="Images/c_ag1_center-piece.jpg" class="contents">
<span id="lblFooter"><center>Copyright © 2006 Anchor General Insurance Agency, Inc. All rights reserved. <br />For questions, please call: (800) 542-6246</center></span>
</td>
<td width="80" background="Images/c_ag1_rightcorner.jpg"></td>
</tr>
</table>
<!-- Popup Form -->
<asp:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server" EnablePageMethods="true">
</asp:ToolkitScriptManager>
<asp:button id="Button3" name="Button3" runat="server" text="Button" style="display: none;" />
<asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server"
targetcontrolid="Button3" popupcontrolid="PopupPanel"
popupdraghandlecontrolid="PopupHeader2" drag="true"
backgroundcssclass="ModalPopupBG">
</asp:ModalPopupExtender>
<asp:Panel ID="PopupPanel" style="display: none" runat="server">
<div class="HellowWorldPopup">
<div class="PopupHeader" id="PopupHeader2"> </div>
<div class="Controls">
<center><table border=0 cellpadding=0 cellspacing=0><tr><td><img src="Images/ajax-loader.gif" /></td><td> Please Wait...</td></tr></table></center>
</div>
</div>
</asp:Panel>
</form>
</body>
</html>
Come to find out (after a VERY long process of trial and error), there's a little something everybody should know about.
You cannot copy
<ToolkitScriptManager>
code from one aspx page to another. You MUST drag it from the toolbox onto your page. I guess it does some stuff we don't see or know about. Same probably goes for ModalPopupExtender.
Hope that helps somebody out there!
I'm using FCKEditor on my asp.net web page. It appears beautifully, and the editor looks really good on the front end. Only problem is, the .Value property is not being set on the postback. No matter what changes the user makes to the value of the control on the page, when I click "Submit", the .Value property remains blank.
I have Googled for other solutions, and most of them are of the variety where there's some conflict with Ajax, such as this and this. My problem is not solved by these solutions; it's much more fundamental than that. I'm not doing anything to do with Ajax; I'm just a simple asp.net newbie with a simple web form, and the value property is not being set on postback, not in IE and not in FF.
It appears that at least one other person has had this problem, but no solution yet.
Any ideas?
Thanks!
New information:
I tried this out on a "hello world" test web site - and the test web site works 100%. There is obviously a problem on my page, but I have no idea where to begin tracking this down.
Here's the markup of my page, in case anyone can see anything obvious that my newbie eyes can't:
<%# Page Language="vb" AutoEventWireup="false" CodeBehind="EmailTemplateEditForm.aspx.vb"
Inherits="EEI_App.EmailTemplateEditForm" %>
<%# Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>EEI - Email Template</title>
<link rel="stylesheet" href="EEI.css">
<script language="javascript" id="jssembleWare" src="sembleWare.js"></script>
<style type="text/css">
.style1
{
height: 251px;
}
.style2
{
width: 2%;
height: 251px;
}
.style3
{
height: 490px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<%# register src="header.ascx" tagname="header" tagprefix="uc1" %>
<%# register src="footer.ascx" tagname="footer" tagprefix="uc1" %>
<uc1:header ID="header1" runat="server" />
<!-- main content area -->
<div class="content">
<!-- title of the page -->
<div class="boxheader">
Email Template
</div>
<div class="standardbox">
<!-- Start Page Main Contents-->
<!-- error messages -->
<div class="errorbox">
<asp:Label ID="lblError" CssClass="ErrorControlStyle" runat="server" EnableViewState="False"
Width="100%"></asp:Label>
</div>
<table class="contenttable">
<tr>
<td align="left" valign="top" class="style3">
<div class="actionbox">
<div class="navheadertitle">
Navigation</div>
<ul>
<li>
<asp:LinkButton ID="btnSubmit" CssClass="LinkButtonStyle" runat="server">Submit</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="btnCancel" CssClass="LinkButtonStyle" runat="server" CausesValidation="false">Cancel</asp:LinkButton>
</li>
</ul>
</div>
</td>
<td align="left" valign="top" class="style3">
<p>
</p>
<table>
<tr class="MCRSFieldRow">
<td class="MCRSFieldLabelCell">
<asp:Label ID="lblEmailTemplate_TemplateName" CssClass="LabelStyle" runat="server"
Width="175">Template Name</asp:Label>
</td>
<td class="MCRSFieldEditCell">
<asp:TextBox ID="txtEmailTemplate_TemplateName" CssClass="TextBoxStyle" runat="server"
Width="100%"></asp:TextBox>
</td>
<td class="MCRSFieldLabelCell">
<asp:Label ID="lblEmailTemplate_TemplateType" CssClass="LabelStyle" runat="server"
Width="175">Template Type</asp:Label>
</td>
<td class="MCRSFieldEditCell">
<asp:RadioButtonList ID="rblEmailTemplate_TemplateType" CssClass="RadioButtonListStyle"
runat="server" RepeatColumns="1" RepeatDirection="Horizontal" Width="135px">
<asp:ListItem Value="1">Cover Letter</asp:ListItem>
<asp:ListItem Value="2">Email</asp:ListItem>
</asp:RadioButtonList>
</td>
<td class="MCRSRowRightCell">
</td>
</tr>
<tr class="MCRSFieldRow">
<td class="MCRSFieldLabelCell">
Composition Date
</td>
<td class="MCRSFieldEditCell">
<asp:Label ID="lblEmailTemplate_CompositionDate" CssClass="ElementLabelStyle" runat="server"
Width="175"></asp:Label>
</td>
<td class="MCRSFieldLabelCell">
Last Used Date
</td>
<td class="MCRSFieldEditCell">
<asp:Label ID="lblEmailTemplate_LastUsedDate" CssClass="ElementLabelStyle" runat="server"
Width="175"></asp:Label>
</td>
<td class="MCRSRowRightCell">
</td>
</tr>
<tr class="MCRSFieldRow">
<td class="MCRSFieldLabelCell">
Composed By
</td>
<td class="MCRSFieldEditCell" colspan="3">
<asp:Label ID="lblPerson_FirstNames" CssClass="ElementLabelStyle" runat="server"></asp:Label>
<asp:Label ID="lblPerson_LastName" CssClass="ElementLabelStyle" runat="server"></asp:Label>
</td>
<td class="MCRSRowRightCell">
</td>
</tr>
<tr class="MCRSFieldRow">
<td class="MCRSFieldLabelCell">
<asp:Label ID="lblEmailTemplate_Subject" CssClass="LabelStyle" runat="server" Width="175">Subject</asp:Label>
</td>
<td class="MCRSFieldEditCell" colspan="3">
<asp:TextBox ID="txtEmailTemplate_Subject" CssClass="TextBoxStyle" runat="server"
Width="100%"></asp:TextBox>
</td>
<td class="MCRSRowRightCell">
</td>
</tr>
<tr class="MCRSFieldRow">
<td class="style1">
<asp:Label ID="lblEmailTemplate_Body" CssClass="LabelStyle" runat="server" Width="175">Body</asp:Label>
</td>
<td class="style1" colspan="3">
<FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" Height="500px">
</FCKeditorV2:FCKeditor>
</td>
<td class="style2">
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<p>
<a class="InputButtonStyle" href="#_swTopOfPage">Top of Page</a>
</p>
</div>
<uc1:footer ID="footer1" runat="server" />
<p>
<asp:TextBox ID="txtEmailTemplate_Body" CssClass="TextAreaStyle" Rows="4" runat="server"
Width="100%" Height="16px" Visible="False"></asp:TextBox>
</p>
</form>
</body>
</html>
Problem with getting value from FCKeditor (FCKeditor.Value) at ASP.Net
1. If initial value FCKeditor.Value not set, there is no problem, all values, which are placed to FCKeditor can get with FCKeditor.Value.
2. Problem: if initial value FCKeditor.Value is not null, then if I want get value, it gives me only initial value.
I have solved!!!!
I spent the whole day ... Hardly found the answer.
Specially registered to write a reply!
Look! Example:
// Set initial value to FCKeditor
void Page_Init(object sender, EventArgs e)
{
DataTable dT_01 = new DataTable();
dT_01 = DataLayerMainContent.ArticlesSelect(2);
FCKeditor_Edit.Value = dT_01.Rows[0]["ArticleText"].ToString();
}
Attention!!!
You have not to do this here!!
protected void Page_Load(object sender, EventArgs e)
{
// Not here!!!
}
// And get Value from FCKeditor
protected void Btn_ContentEditedSave_Click(object sender, EventArgs e)
{
//FCKeditor_Edit.Value
// And add this value to DataBase
DataLayerAdminPost.ContentMainEdit(1, FCKeditor_Edit.Value);
Response.Redirect(Request.RawUrl);
}
Main Idea!
Set initial value to FCKeditor at Page_Init!
Have you got ViewState enabled? ANS = Yes
EDIT: OK, then inside the Page_Init event try adding the following:
Page.RegisterRequiresPostBack(FCKeditor1);
The solution above didn't work for me, however i found solution here
Here's code what I used
protected void Page_Load(object sender, EventArgs e)
{
ScriptManager.RegisterOnSubmitStatement(
this,
this.GetType(),
"AjaxHack", "for ( var i = 0; i < parent.frames.length; ++i ) if ( parent.frames[i].FCK ) parent.frames[i].FCK.UpdateLinkedField();");
}
Hope that saves someones day. I was looking for the solution for 2 months.
Cheers