Posts

silverlight - Get ResponseHeaders from WebClient after OpenReadCompleted -

i filename out of content-disposition header when webclient openreadasync completed. can see header in response in fiddler, when try access silverlight system.notimplementedexception - property not implemented class. is there way these headers? response headers not supported in browser http handling. must specify client http handling before calling httphandler: bool httpresult = webrequest.registerprefix("http://", webrequestcreator.clienthttp); webclient wc = new webclient(); wc.openreadcompleted += new openreadcompletedeventhandler(wc_openreadcompleted); wc.openreadasync(...); the result headers available on webclient object in wc_openreadcompleted method. have at: http://msdn.microsoft.com/en-us/library/dd920295(v=vs.95).aspx

jquery - toggle divs, but only have one shown at once -

i have thumbnails slidetoggle hidden div. want 1 stay open @ once though. when next thumbnail clicked, open div closes , new 1 opens. i doing show , hide, looks bad because loose animation slidetoggle. so what's best way hide toggled divs , open new one? here html: <div id="maincontainer"> <div id="rowone"> <img src="illinoislottery_thumbnail_taller.jpg" id="rowoneleftimage" /> <img src="illinoislottery_thumbnail_taller.jpg" id="rowonemiddleimage" /> <img src="illinoislottery_thumbnail_taller.jpg" id="rowonerightimage"/> </div> <div id="rowoneleftimagehidden"> information left image in first row. </div> <div id="rowonemiddleimagehidden"> information middle image in first row. </div> <div id="rowonerightimagehidden"> information right image in first row. ...

PHP html generator class -

i use class create html content http://code.google.com/p/php-class-html-generator/ i try build table in way , html result wrong... $messalist = array(...); $html = htmltag::createelement('table')->id( $attr['id'] ); foreach($messagelist $message){ $html->addelement('tr') ->addelement('td')->settext($message['subject']) ->addelement('td')->settext($message['from']) ->addelement('td')->settext($message['date']) ->addelement('td')->settext($message['size']); } echo $html; how in right way? thanks this generated html: <table id="messagelist"> <tr> <td> <td> <td> <td>1.91kb</td>23 feb 11:56 am</td>to: me@me.com</td>re: helooo</td></tr> <tr> <td> <td...

c# - Cache Entity Framework data and track its changes? -

what want pretty simple conceptually can't figure out how best implement such thing. in web application have services access repositories access ef interacts sql server database. of these instanced once per web request. i want have layer between repositories , ef (or services , repositories?) statically keeps track of objects being pulled , pushed database. the goal, assuming db-access accomplished through application, know fact unless repository access ef , commits change, object set didn't change. an example be: repository invokes method getallcarrots(); getallcarrots() performs query on sql server retrieving list<carrot> , if nothing else happens in between, prevent query being made on sql server each time (regardless of being on different web request, want able handle scenario) now, if call buycarrot() adds carrot table, want invalidate static cache carrot s, make getallcarrots(); require query database once again. what resources on database c...

dowload file from shared drive to desktop C# -

i'm trying download file shared drive desktop keeps throwing error not virtual path. here code: if (directory.exists(server.mappath("m://shareddrive//" + username))) { file.copy("m://shareddrive//" + username, "c:\\documents , settings\\user\\desktop\\" + username, true); } are doing in asp.net application? (i'm guessing since using server.mappath ). have 2 problems: iis runs in service session, has no access users' mapped drives such m: . iis can access physical drives, or unc paths (the latter requires security set correctly). iis has no access user's desktop. please explain bit more detailed trying achieve if able help.

c# - How to abstract a static classes -

i have static class. can modify , make extends interface\abstract class. it contains lots of readonly , consts members. staic methods. in order make code testable, want to separate dto , manager. abstract each of them. how classes static? in opinion there 2 things static classes for: providing global functions/algorithms (that should not depend on state - a.k.a pure functions) hold global data if model methods in there pure can test right away. global data (your constants , read-only members) on other hand don't need testet should produced said methods. so if static methods use global data class refactor them include data parameters method, overload simple wrappers feeding global data , test new - pure - functions. take care include things database-data or system-times (datetime.now) , similar side-effect data methods well. if parameterlist gets big refactor method class some/most of parameters encapsulated new classes fields - remember s solid...

pdf - asp.net, how do you separate a repeater using page break -

i'm trying create batch of letters using repeater far when convert letters pdf contents of letters written 1 after other on same page. want split repeater each letter has own page. how do this? please me!! :) usually when convert pdf, page breaks controlled standard css styles page-break-before:always , page-break-after:always applied html object. these styles can used either in css class applied element or inline in element style attribute. so in repeater should (pardon pseudo code): <asp:repeater> <itemelement> <div style="page-break-after:always;"> <asp:label id="lblletter"> </div> </item> </asp:repeater> where lblletter set letter in server-side event.