Hello All,
I have tried the http://weblogs.asp.net/scottgu/archive/2006/10/22/Tip_2F00_Trick_3A00_-Cool-UI-Templating-Technique-to-use-with-ASP.NET-AJAX-for-non_2D00_UpdatePanel-scenarios.aspx
I made the change to avoid errors as follows
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DisplayTime.aspx.cs" Inherits="DisplayTime" %>
<%
@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head id="Head1" runat="server">
<title>Hello World Service</title><%-- <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
--
%>
<script type="text/javascript" language="javascript" >
function callServer() {SimpleService.GetMessage( $get("Name").value,displayMessageCallback);
}
function displayMessageCallback(result) {$get("message").innerHTML = result;
}
</script>
</head>
<
body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" >
<Services><%-- <asp:ServiceReference Path="~/SimpleService.asmx" />--%>
<asp:ServiceReference Path="~/App_Code/SimpleService.asmx"/>
</Services>
</asp:ScriptManager>
<h1>Hello World Example</h1>
<div>
Enter Name:
<input id="Name" type="text" />
<a href="javascript:callServer();">Call Server</a>-----------Change
<div id="message"></div>
</div>
</form>
</
body>
</
html>
Webservice
/// <summary>
///
Summary description for SimpleService
///
</summary>[WebService(Namespace = "http://tempuri.org/")]
[
WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
//[Microsoft.Web.Script.Services.ScriptService]--------->original
[System.Web.Script.Services.
ScriptService]---------->I change it to following as above assembly was throwing the assembly reference error
public
class SimpleService : System.Web.Services.WebService
{
public SimpleService()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]public string HelloWorld()
{
return "Hello World";
}
[WebMethod]public string GetMessage(string name)
{
return "Hello <strong>" + name + "</strong>, the time here is: " + DateTime.Now.ToShortTimeString();
}
}
What is going wrong with this ?
Swati
create template
create site column
create content type
Add template and site columns to content type
Add content type to document library
---------------------------------------
public class Block : System.Web.UI.WebControls.WebParts.WebPart
{
string m_scriptBlock = "";
string m_scriptKey = "scriptKey";
//Key Property
[Personalizable(PersonalizationScope.Shared), WebBrowsable(true),
WebDisplayName("Script Key"),
WebDescription("A unique key for the script.")]
public string ScriptKey
{
get { return m_scriptKey; }
set { m_scriptKey = value; }
}
//Script Property
[Personalizable(PersonalizationScope.Shared), WebBrowsable(true),
WebDisplayName("Script"),
WebDescription("The JavaScript to insert in the page.")]
public string Script
{
get { return m_scriptBlock; }
set { m_scriptBlock = value; }
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
if (m_scriptBlock != "" &&
!Page.ClientScript.IsClientScriptBlockRegistered(m_scriptKey))
Page.ClientScript.RegisterClientScriptBlock(
typeof(string), m_scriptKey, m_scriptBlock, true);
}
}
-----------------------------------------
protected override void CreateChildControls()
{
base.CreateChildControls();
try
{
if (_userControl != defaultText)
{
_control = this.Page.LoadControl(_userControl);
}
else
{
_control = new LiteralControl(string.Format("To link to content,
open the tool pane and then type a URL in the Link text box.", 1, 129, this.ID));
}
}
catch (System.Exception ex)
{
_control = new LiteralControl(string.Format("
Error: unable to load {0}
Details: {1}", _userControl, ex.Message));
}
if (_control != null)
{
// Add to the Controls collection to support postback
this.Controls.Add(_control);
}
}
-------------------------------------------------------------------------
opening the template inline in list view?
Redirecting different content type to different folder
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES --for multiple sharepont apps
------------------------------------------------------
For creating webPart automatic
create blank project --> add new component --> webpart
--------------------------------------------------------
custom event Handler
In class library
orders.EventReceivers.Add