Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

ASP.NET AJAX 4.0 Live binding - Issue with Sys.registerComponent -


i trying design client template using ajax 4.0 framework live binding.

i have wcf service defined called vesseldata (will provide code if needed) returns datatable class called vesselcollection. also, referencing following scripts in master file: microsoftajax.debug.js, microsoftajaxdatacontext.debug.js, microsoftajaxtemplates.debug.js.

the problem templates donot fill data, , fetchdata method on datacontext goes failcallback method without way know went wrong. moreover, several javascript errors "object doesnt support property or method" on "sys.registercomponent" inside 1 of .js files.

please, need here..

code:

< %@ page title="" language="c#" masterpagefile="~/site.master" autoeventwireup="true" codebehind="vessels.aspx.cs" codefile="~/vessels.aspx.cs" inherits="sampleajaxdatabinding.vessels" %>  < %@ register assembly="ajaxcontroltoolkit" namespace="ajaxcontroltoolkit" tagprefix="cc1" %>  < asp:content id="content1" contentplaceholderid="headcontent" runat="server">   < script type="text/javascript">      var datacontext = new sys.data.datacontext();     datacontext.set_serviceuri("../services/vesseldata.svc");     datacontext.initialize();      function bind() {         datacontext.fetchdata("getvesseldata", { $top: 1 }, sys.data.mergeoption.overwritechanges, "get", function () { document.getelementbyid("template").style.display = "block"; alert('fetch succeeded.'); }, function (error) { alert('fetch failed \n' + error.valueof().tostring()); }, 2000);     }    < /script>  <style type="text/css"> .sys-template { display:block; visibility:visible; } </style>  </asp:content> <asp:content id="content2" contentplaceholderid="maincontent" runat="server">     <cc1:toolkitscriptmanager id="toolkitscriptmanager1" scriptmode = "release" runat="server">     <services>         <asp:servicereference path="~/services/vesseldata.svc" />     </services>     </cc1:toolkitscriptmanager>    < div id = "view">     < ul id="template"          class="sys-template" sys:attach="dataview"         dataview:autofetch="true"         dataview:dataprovider="datacontext"         dataview:fetchoperation="getvesseldata">         < li>                < h3>{{ vesselname }}</h3>               < div>                 {{ vesselid }} <br />                 {{ companyid }} <br />                 {{ publishquestionnaire88 }} <br />               < /div>         </li>     </ul>    </div > <input type="button"        value="perform binding"        onclick="bind()" /> 

i had same problem using ajax script files cdn until realize sys.registercomponent defined on microsoftajax.debug.js comes on sdk on odata.org here. not weird enough if use minified version microsoftajax.js breaks on if (serviceuri) { this.set_path(serviceuri); } saying set_path not defined.

in end had use debug version of microsoftajax, microsoftajaxdatacontext, microsoftajaxopendata , microsoftajaxtemplates , manualy compress files release.

i hope find out of mistake , fix respective files , upload new version cdn.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -