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.

vb.net - ScriptManager is not declared - err msg -



i've class , gave me error name 'scriptmanager not declared'

public notinheritable class responsehelper private sub new() end sub public shared sub redirect(byval response httpresponse, byval url string, byval target string, byval windowfeatures string)     if ([string].isnullorempty(target) orelse target.equals("_self", stringcomparison.ordinalignorecase)) andalso [string].isnullorempty(windowfeatures)         response.redirect(url)     else         dim page page = directcast(httpcontext.current.handler, page)         if page nothing             throw new invalidoperationexception("cannot redirect new window outside page context.")         end if         url = page.resolveclienturl(url)         dim script string         if not [string].isnullorempty(windowfeatures)             script = "window.open(""{0}"", ""{1}"", ""{2}"");"         else             script = "window.open(""{0}"", ""{1}"");"         end if         script = [string].format(script, url, target, windowfeatures)         scriptmanager.registerstartupscript(page, gettype(page), "redirect", script, true)     end if end sub  

end class

this code link:
http://weblogs.asp.net/infinitiesloop/archive/2007/09/25/response-redirect-into-a-new-window-with-extension-methods.aspx

i've been 8 hours trying figure out how open new page , send parameters it. , found code , , 6 hours trying apply nothing.

thanks.

you need ajax installed access scriptmanager. use page.clientscript.registerstartupscript instead. if want solution works whether ajax available or not, have at link.


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 -