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.

Merge two (or more) lists into one, in C# .NET -

is possible convert 2 or more lists 1 single list, in .net using c#? for example, public static list<product> getallproducts(int categoryid){ .... } . . . var productcollection1 = getallproducts(categoryid1); var productcollection2 = getallproducts(categoryid2); var productcollection3 = getallproducts(categoryid3); you can use linq concat , tolist methods: var allproducts = productcollection1.concat(productcollection2) .concat(productcollection3) .tolist(); note there more efficient ways - above loop through entries, creating dynamically sized buffer. can predict size start with, don't need dynamic sizing... could use: var allproducts = new list<product>(productcollection1.count + productcollection2.count + productcollection3.count); allproducts.addrange(productcollection1); allproducts.addrange(product...

When will PowerPivot support automatic relationships in OData? -

i've read powerpivot doesn't support automatic creation of entity relationships when consuming odata feeds. can confirm , aware of powerpivot odata roadmap? coming? thanks, mike yes correct. relationships lost when imported powerpivot. this why best practice expose foreignkey properties data services, way can rebuild relationship in powerpivot. in terms of when / if powerpivot add better support relationships - ( program manager ) on odata team hope so, there isn't firm commitment or timeframe yet.

What is the difference between the ResourceControllerFactory and the DefaultControllerFactory in ASP.NET MVC? -

what difference between resourcecontrollerfactory , defaultcontrollerfactory in asp.net mvc? context: looking hook ioc container controller factory - have overriden defaultcontrollerfactory this, see resourcecontrollerfactory being used in project working with. does 1 provide improved support rest apis? code each: defaultcontrollerfactory public class defaultcontrollerfactory : icontrollerfactory { // fields private ibuildmanager _buildmanager; private controllerbuilder _controllerbuilder; private controllertypecache _instancecontrollertypecache; private static controllertypecache _staticcontrollertypecache; // methods static defaultcontrollerfactory(); public defaultcontrollerfactory(); internal static invalidoperationexception createambiguouscontrollerexception(routebase route, string controllername, icollection<type> matchingtypes); public virtual icontroller createcontroller(requestcontext requestcontext, string contro...

How I Can Refresh ListView in WPF -

hi using wpf , adding 1 one record listview.itemssource data appear when data included want added 1 one show me record used listview.item.refresh() did't work. is there way.. thanks... if still need refresh listview in other case (lets assume need update 1 time after elements added itemssource) should use approach: icollectionview view = collectionviewsource.getdefaultview(itemssource); view.refresh();

Magento - Select zip code and address for customer(s) -

how can retrieve address , zip code of 1 or more customers in frontend module? thank you. use following code:- (edited after nice codes @clockworkgeek ) <?php $primaryaddress = mage::getsingleton('customer/session')->getcustomer() ->getprimaryshippingaddress(); $arrcountrylist = mage::getmodel('directory/country_api')->items(); $countryname = ''; foreach($arrcountrylist $_eachcountrylist) { if ($primaryaddress['country_id'] == $_eachcountrylist['country_id']) { $countryname = $_eachcountrylist['name']; break; } } $countryname = mage::getmodel('directory/country') ->loadbycode($primaryaddress->getcountryid()) ->getname(); echo '<br/>street address: '.$primaryaddress->getstreet(); echo '<br/>city: '.$primaryaddress->getcity(); echo '<br/>state/region: '.$primaryaddress-...

How to determine if we're at the bottom of a page using Javascript/jQuery -

there nothing called scrollbottom() in jquery, can't $(window).scrollbottom()==0 hope question clear title itself. appreciated. i'm interested in ie7+, ff3.5+ (chrome etc bonus!) thanks! you use function check whether element visible (e.g. element @ bottom of page): function isscrolledintoview(elem) { var docviewtop = $(window).scrolltop(); var docviewbottom = docviewtop + $(window).height(); var elemtop = $(elem).offset().top; var elembottom = elemtop + $(elem).height(); return ((elembottom >= docviewtop) && (elemtop <= docviewbottom)); } i implemented endless scrolling effect (like in facebook) it. you can check each time, user scrolling window: function checkandload(){ if(isscrolledintoview($('#footer'))){ triggersomething(); // } } $(document).ready(function(){ checkandload(); $(window).scroll(function(){ checkandload(); }); });

java - GridBagLayout not placing components at page start -

Image
i using grid bag layout java application, problem is, not placing components in page start. here code using: import javax.swing.*; import java.awt.*; import java.awt.event.*; public class trial extends jframe { jlabel banner; container c; gridbagconstraints gbc = new gridbagconstraints(); gridbaglayout gbl; public trial() { settitle("attendence manager"); seticonimage(toolkit.getdefaulttoolkit().getimage("images/icon.png")); dimension dim= toolkit.getdefaulttoolkit().getscreensize(); setsize(new dimension(dim.width-20,dim.height-100)); c= getcontentpane(); gbl= new gridbaglayout(); setlayout(gbl); banner = new jlabel(new imageicon("images/banner.jpg")); gbc.anchor=gridbagconstraints.page_start; gbc.gridx=0; gbc.gridy=0; gbc.gridwidth=gridbagconstraints.remainder; c.add(banner,gbc); this.setvisible(true); addwindowlistener(new mywindowadapter()); } public static void main(s...