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.

c# - Mouse Down Event not firing (Bubbling events) -


i novice wpf. started learning routedevents in wpf. tried sample , met problem

    <grid margin="5" name="grid" mousedown="window_mouseup">     <grid.rowdefinitions>         <rowdefinition height="auto"/>         <rowdefinition height="*"></rowdefinition>         <rowdefinition height="auto"></rowdefinition>         <rowdefinition height="auto"></rowdefinition>     </grid.rowdefinitions>     <label borderbrush="black" borderthickness="1" grid.row="0" margin="5"        name="fancylabel" mousedown="window_mouseup" >         <stackpanel name="stack" mousedown="window_mouseup">              <textblock margin="3" name="txtblock1">                 click             </textblock>             <textblock margin="50" name="txtblock2" >                 click me             </textblock>         </stackpanel>     </label>     <listbox grid.row="1" margin="5" name="listmessages"/>     <button grid.row="3" margin="5" name="cmd_clear" mousedown="cmd_clear_mousedown"  >clear</button> </grid> 

the handler mousedown event of button different others int tree hierarchy. event not firing..

but if add in .cs file following code

 grid.addhandler(uielement.mousedownevent, new mousebuttoneventhandler(window_mouseup),true);  stack.addhandler(uielement.mousedownevent, new mousebuttoneventhandler(window_mouseup), true);  fancylabel.addhandler(uielement.mousedownevent, new mousebuttoneventhandler(window_mouseup), true);  txtblock1.addhandler(uielement.mousedownevent, new mousebuttoneventhandler(window_mouseup), true);  txtblock2.addhandler(uielement.mousedownevent, new mousebuttoneventhandler(window_mouseup), true);  img1.addhandler(uielement.mousedownevent, new mousebuttoneventhandler(window_mouseup), true);  cmd_clear.addhandler(uielement.mousedownevent, new mousebuttoneventhandler(cmd_clear_mousedown), true); 

the cmd_clear_mousedown event fired , event bubbled grid , grid fires window_mouseup.

two points:

1) mousedown="window_mouseup" everywhere intended?

2) why not register click event clickmode="press" instead of mousedown. don't think button provides/raises mousedown unless may custom template.

example:

<button grid.row="3"         margin="5"         name="cmd_clear"         clickmode="press"         click="cmd_clear_mousedown">clear</button> 

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 -