Posts

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.

entity framework - EF CTP 5 create and persist object graph trouble -

code: something smt = new something(){ prop = 123, prop2 = "asdad" } foreach(var related in relatedsomething) { smt.related.add(new related(){ relatedprop = 123, }; } runtime gives me error null reference. related virtual icollection. no foreign key fields in entities defined. on contrary if do foreach(var related in relatedsomething) { db.related.add(new related(){ relatedprop = 123, = smt }; } it works. although, want work in first snippet. doing wrong? 'cos in shipped ef4 works both ways. model classes (relevant part): public class printer { public int id { get; set; } public string name { get; set; } public virtual icollection<replica> replicas { get; set; } } public class replica { public int id { get; set; } public virtual printer printer { get; set; } } public class printerscontext: dbcontext { public dbset<printer> printers { get; set; } public dbset<replica> replica...

process - Python - what is difference in os.popen and subprocess.Popen? -

python - difference in os.popen , subprocess.popen? the os process functionality considered obsolete. subprocess module introduced in python 2.4 unified, more powerful replacement several older modules , functions related subprocesses. listed here : os.system os.spawn* os.popen* popen2.* commands.* os.popen deprecated in python 2.6 (but, interestingly, not deprecated in python 3.1). there paragraph in documentation on how replace subprocess.popen .

WebView android proxy -

i know how setting proxy manually , use in webview. settings -> wireless networks ->mobile networks-> access point names->telkila. enter proxy server address , port (which 80). webview.enableplatformnotifications(); but can set proxy setting code? user didn't have set manually? thanks there no legal way change webview proxy settings programmatically. it's possible use java reflection change mproxyhost value android.net.http.requestqueue class. it's private value , there no setters it, reflection seems possible variant. used in project , works. here sample of method: private boolean setproxyhostfield(httphost proxyserver) { // getting network class networkclass = null; object network = null; try { networkclass = class.forname("android.webkit.network"); field networkfield = networkclass.getdeclaredfield("snetwork"); network = getfieldvaluesafely(networkfield, null); } ca...

.net - WPF and creating a "endless" canvas -

i trying make small drawing program small children. thinking on making canvas , , allowing them draw on it. not want specify size, want zoom out , allow "endless" piece of paper (using pan + zoom navigate). how do this, canvas seems have fixed size, , resizing doesn't seem work, how zoom, drawings doesn't seem vector based, "jagged" when zooming close. any other control better? have @ inkcanvas control, gives area board may draw or handwrite; apart provides various other features out of box. can find sample implementing zooming in inkcanvas. helpful links - draw using inkcanvas: http://www.kirupa.com/blend_wpf/inkcanvas_pg1.htm seres of articles on using inkcanvas- http://blogs.msdn.com/b/swick/archive/tags/fun+with+ink+_2600_amp_3b00_+xaml/

php - How do I use phpdocumentor web interface? -

i'm trying document code using phpdocumentor.. know how use phpdocumentor web interface or tutorial explaining this? have read phpdoc tutorials , quickstart ? it tells need know supported tags through how install , run documentation generator, etc. it mentions how use docbuilder web interface .

c# - Watin : Get Row Count from table -

hi i'm trying row count table using watin ie 1.get table (done) 2.count rows in table (not done) 3.compare count (already have idea) how row count table,using watin?any ideas?can point me right direction hi guys;thanks helping,i hit roadblock here i'm using this int countnumberofrows = this.elements.joblistinggrid.owntablerows .skip(1) .where(r => !r.classname.contains("rowhidden")) .count(); ok i'm able count '21' :),my problem page using same control,and number of row each page same if click activelink rows 21 , if click on pendinglink although rows hidden still 21.i need differentiate number of rows because way me this if (countnumberofrows != 0) { this.elements.activelink.click(); } else { this.elements.pendinglink.click(); } is idea possible?or need @ way if have table tablerows collection gives number of rows: ...

C# Foreach usercontrols I added to a page -

i've got code: protected void ddltemplate_selectedindexchanged(object sender, eventargs e) { template t = new template(); t.loadbyid(convert.toint32(ddltemplate.selecteditem.value)); foreach (widget w in t.templatewidgets) { usercontrols_widget ucwidget = (usercontrols_widget)loadcontrol("~/usercontrols/ucwidget.ascx"); ucwidget.widgettitle = w.name; ucwidget.parameters = w.parameters; pnlwidgets.controls.add(ucwidget); } } protected void lnksubmit_click(object sender, eventargs e) { foreach (control cc in pnlwidgets.controls) { } } basically i'd foreach widgets added page in ddltemplate_selectedindexchanged event. question how usercontrols added. you can add usercontrols list<usercontrols_widget> , loop through instead of looping through controls on page.