Posts

c# - MVC 4 @Html.DropDownListFor() not passing model values to dropdown -

i new mvc , trying test application feet wet. part of application generate form drop down box. use @html.dropdownlistfor() generate this, , on create form drop down works fine. when go edit form model value not passing drop down. selectlist item public static string[] onofflist() { var ret = new string[] { "on", "off" }; return ret; } form code @html.dropdownlistfor(model => model.servicecondition, new selectlist(onoffdropdownhelper.onofflist())) for instance assume model.servicecondition = "off". for reason whenever call form dropdown value "on", seems ignoring model value. i have tried this @html.dropdownlistfor(model => model.servicecondition, new selectlist(onoffdropdownhelper.onofflist(), "off")) to mandate "off" value, still coming "on" selected value in drop down. i reiterate, know model value "off", , created identical "create" for...

asp classic - Mixing ASP.NET pages with ASP Pages in windows server 2003 IIS -

i've got lot of classic asp pages in production on windows server 2003 64-bit machine. i've got .net on there working. i'm starting move asp ajax pages (pages receive ajax calls classic asp) asp.net/c# take advantage of business/data/logging layer i've got set there in c#. i've figured on securing aspx pages way of "token" create in database in asp , pass aspx page, uses validate it's legit call , destroys it. my big question - aside making aspx pages, need compile app same site asp site? assumed i'd - deploy there alongside asp classic pages, , call aspx individually needed. is strategy sound? need special performance or configuration make asp classic , asp.net coexist well? thanks - migration has been bear because of extreme asp classic dependency. it work fine. i've seen on several sites. put them in same directory. your biggest issue asp , asp.net pages each have own session , application variables won't shared ...

php - Improving while coding -

i need check if monthly contract exist , if signed. improve code because seems heavy it's time switch pdo , maybe can rewrite things speed script basically have table 2 columns 1st column have date reference, 2013/jan, 2013/fev ... , 2nd column display check if document exist , have signature. here code. there way improve? // query db // contract $contract = array(); $query1 = mysql_query("select * contracts ic_id='28'"); while ($row = mysql_fetch_assoc($query1)) { $contract[] = $row['month']; } $signature = array(); $query1 = mysql_query("select * contracts ic_id='28'"); while ($row = mysql_fetch_assoc($query1)) { $signature[] = $row['sign']; } // start , end date $startyear = '2012'; $startmonth = '12'; $endyear = '2013'; $endmonth = '12'; $startdate = strtotime("$startyear/$startmonth/01"); $end...

php - Multiple sending of email with attachment - repost -

i re-posting because no 1 answered previous post. i trying send emails multiple recipients respective pdf files attached. successful sending emails multiple recipient recipients receive multiple emails. number of emails received recipient number of email addresses stored in database. the second problem have encountered attachment sent recipients same file. scenario should this: recipient should have email attached pdf a, recipient b pdf b, on , fort. those pdf's have file names correspond unique control number each recipient has. e.g. recipient has control number 1234, pdf named 1234.pdf. i tried wile loop in $ctrl_no = mysql_result($ctrl, 0) gives error saying memory limit of server has reached. hope solve 2 problems. $input = addslashes($_post['dep']); $email = "select email_address student y y.center = '$input'"; if ($p_address=mysql...

Optimization of PHP -

hello i've got php code in project $idlist = array() // code // code while ($row = mysql_fetch_array($res)) { $roid=$row['id']; $roroom=$row['room']; $ro24=$row['24.09']; $ro25=$row['25.09']; $ro26=$row['26.09']; $ro27=$row['27.09']; $ro28=$row['28.09']; $ro29=$row['29.09']; $ro30=$row['30.09']; $ro01=$row['01.10']; $ro02=$row['02.10']; $ro03=$row['03.10']; $ro04=$row['04.10']; $ro05=$row['05.10']; $ro06=$row['06.10']; $ro07=$row['07.10']; if (in_array($ro24, $idlist)) { } else { array_push($idlist, $ro24); } if (in_array($ro25, $idlist)) { } else { array_push($idlist, $ro25); } if (in_array($ro26, $idlist)) { } else { array_push($idlist, $ro26); } if (in_array($ro27, $idlist)) { } else { array_push($idlist, $ro27); } if (in_array($ro28, $idlist)) { } else { array_push($idlist, $ro28); } if (in_array($ro29, $idlist)) { } else { array_push($idlist, $r...

javascript - jQuery - Sticky header that shrinks when scrolling down -

i wonder how make sticky header shrink(with animation) when scroll down page , goes normal state when page scrolled top. here 2 examples clearify: http://themenectar.com/demo/salient/ http://www.kriesi.at/themes/enfold/ i part make fixed, how should shrink header when user scrolls down? thanks ton this should looking using jquery. $(function(){ $('#header_nav').data('size','big'); }); $(window).scroll(function(){ if($(document).scrolltop() > 0) { if($('#header_nav').data('size') == 'big') { $('#header_nav').data('size','small'); $('#header_nav').stop().animate({ height:'40px' },600); } } else { if($('#header_nav').data('size') == 'small') { $('#header_nav').data('size','big'); $('#header_nav').stop().animate({ height:'100px...

c++ - object inheritance virtual function run fail error -

shape *shape[100];//global scope square sqr;//global scope void inputdata() { int len,width; cout << "enter length"; cin >> len; cout << "enter width"; cin >> width; square sqr(len,width); shape[0] = &sqr; //----> if shape[0]->computearea(); here works fine. } void computearea() { shape[0]->computearea(); // --> run fail error } shape parent class , square sub-class. both have computearea(); when code reach computearea() having weird run fail error. program terminate without giving me errors me find , fix it...it show run fail , stop program. the program able run , show ->computearea() if code within inputdata() when separate it, fail run properly. solution this? this square square sqr(len,width); is instance local scope of inputdata . once leave scope, left dangling pointer in shape[0] . if want set global sqr , need sqr = square(len,width); you should find solution doesn't rely on global...