views:

25

answers:

0

consider following code

i have used ajax 4.0 with MVC framework

<script type="text/javascript" src="/scripts/MicrosoftAjax.js"></script>
<script type="text/javascript" src="/scripts/MicrosoftAjaxTemplates.js"></script>

<div  id="divdata"  class="sys-template" >
<p>Event Title:<asp:TextBox ID="TextBox1" runat="server">{{ title }}</asp:TextBox>
    </p>    

<p>Event Data :<asp:TextBox ID="muldata" runat="server" Text="{{data}}"></asp:TextBox>
</p>   

<p>Event Description:<input type="text" id="description" alue="{{ description }}"  
    /></p>

<p>Event Date: <input type="text" id="date" value="{{ date }}"/></p>

  </div> 

<div id="datashow"></div> 



<script type="text/javascript">
 Sys.Application.add_init(appInit);
 function appInit() {debugger;
              start();

 }
</script>

<script type="text/javascript" src="/Scripts/Service.js"></script>

the service.js file would get the data from service and render it to empty div "datashow" getting template "divdata"

this is all in Index page somewhare in **service.js **file

var t = new Sys.Preview.UI.Template.getTemplate($get("divdata"));
  t.createInstance($get("datashow"),
    {
        title: title,
        data: data,
        date: date,
        description: description,
        keywords: keywords
    });

\the divdata and datashow has to on one page for above script to work!!

now! i want to separate the templates from the index page (ie would be on different page[say,.ascx]) the index page will only contain an empty div and from index page a link will render template page and another link will render another page associated with it. so a user can edit template (html) without harming code (service.js,and other scripts)

i want index page to show only a link ...which onclick will render a template associated with it and show it on **index ** page

please help me achieve this!!