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 mvc - Client side validation script is not generated for partial views fetched using AJAX -


i trying setup client side validation using microsoftmvcjqueryvalidation work ajax submitted forms. works fine if partial view rendered directly view. when try fetch on xhr, example show in jquery dialog, client validation javascript not generated output html. ideas?

working code - partial view rendered using html.renderpartial:

view:

<%@ page title="" language="c#"  inherits="system.web.mvc.viewpage<dynamic>" %> <asp:content id="content2" contentplaceholderid="maincontent" runat="server">  <% html.renderpartial("new"); %> </asp:content> 

partial view:

<%@ control language="c#" inherits="system.web.mvc.viewusercontrol<product>" %> <% html.enableclientvalidation();%>  <% html.beginform();%>   <%= html.editfield(m => m.price)%>   <%= html.validationmessagefor(m => m.price)%> <% html.endform();%> 

not working code - partial view fetched jquery load() function.

view:

<%@ page title="" language="c#"  inherits="system.web.mvc.viewpage<dynamic>" %> <asp:content id="content2" contentplaceholderid="maincontent" runat="server">   ....   $("#dialog").load('~/product/new/');  $("#dialog").dialog("open");   ....   <div id="dialog" title=""></div> </asp:content> 

relevant controller action:

public partialviewresult new(int id) {   return partialview(service.getproduct()); } 

thanks.

this happen partial views return javascript inserted dom via ajax. problem javascript returned partial view not executed/interpreted when inserted document.

unfortunately, because dealing generated javascript can explain why experiencing problem i'm @ loss solution. function wrote i'd suggest adding oncomplete. can offer javascript limitation , start looking there.

btw: looks promising http://adammcraventech.wordpress.com/2010/06/11/asp-net-mvc2-ajax-executing-dynamically-loaded-javascript/


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 -