MVC2 ActionFilterAttribute – During OnActionExecuting Don't use Redirect Use RedirectResult

יום רביעי, אפריל 28, 2010

Still haven't upgraded to the visual studio 2010 RTM, so I'm talking about version RC1 of MVC2(the one that shipped with VS2010 RC),But i guess this is also the case with the RTM version.We followed the excellent post by Rob Conery and implemented our own ActionFilterAttribute to validate that only authenticated users gain access to some of the actions.At OnActionExecuting we checked for anonymous users and redirected them to the login page. All went well till Accidentally i stumbled upon an exception right before the user was redirected to the login page,users will never see this exception, but the...

Simple RTFEM OR why asp.net MVC [ValidateInput(false)] doesn't disable request validation on asp.net 4

יום רביעי, מרץ 24, 2010

Have been doing a lot of asp.new MVC the past three months, learning it as we build the project(hope to share more in the near future).We are using visual studio 2010, so now we're stuck with MVC2 RC1 since RTM wasn't shipped for the the RC version of 2010 (and yes this is a huge rant!!, we are stuck with 2010 since we also chose to work with entity framework 4 which only work on framework 4.0).This is why i suspect every feature that doesn't work well as a problem of an early release.Before i get to the point,...

jQuery Gotcha: val() might select the wrong option at a select element

יום שני, מרץ 22, 2010

Let's imagine you have the following select element: <select id="someSelect">  <option value="">-Select-</option>  <option value="12">21</option>  <option value="11">20</option>  <option value="10">19</option>  <option value="9">18</option>  <option value="8">17</option>  <option value="7">16</option>  <option value="6">15</option>  <option value="5">14</option>  <option value="4">13</option>  <option value="3">12</option>  <option value="2">11</option>  <option value="1">10</option></select> Notice that the text in some options appears as value in other options.you can get a select like this when composing an age drop down for example. Now for the Gotcha: which option will be chosen as a result of the following expression:$("#someSelect").val("12");???Answer: the selected option will be...
תגובה אחת