Coderock

--------------------------------
link hover image

MVC: Pass values from controller to view using jquery

Frontpage calendar image August 8, 2014

To pass values from controller to view using jquery you can use jQuery’s available .ajax() function to handle this depending on your needs : public class TestController : Controller { public ActionResult TestAction(string input1, string input2) { // } } var input1 = $(‘#control1’).val(); var input2 = $(‘#control2’).val(); jQuery.ajax() – Perform an asynchronous HTTP (Ajax) […]

link hover image

IE9 Select input with input-group-addon pushes html datepicker outside form

Frontpage calendar image July 31, 2014

If you have this problem in ie9: input with input-group-addon pushes html datepicker outside form   Solutie: The fix is to add float:left to the select box. .ie9AddOnSolution { float: left; } < div class="input-group "> @Html.TextBoxFor(m => m.StartDate, new { @class = “form-control ie9AddOnSolution datepicker-plugin-input no-extended-select” }) @Html.LabelFor(m => m.EndDate, new { @class = “input-group-addon” }) @Html.TextBoxFor(m […]

link hover image

XCOPY in a post-build event to copy compiled DLLs from their output folders to the main app’s output folder

Frontpage calendar image July 30, 2014

I am using XCOPY in a post-build event to copy compiled DLLs from their output folders to the main app’s output folder. The DLLs are being copied to a “Modules” subfolder in the main app output folder, like this:   Example: xcopy “$(TargetDir)$(TargetName).dll” “$(SolutionDir)_DropFolder” /F /R /Y /I does not work and return code 2, […]

link hover image

SQL Creating Full Text Catalog and Full Text Search

Frontpage calendar image June 29, 2014

Sql error message: Msg 7601 Cannot use a CONTAINS or FREETEXT predicate on table or indexed view ‘yourView’ because it is not full-text indexed. I’ll show you how to creating Full Text Catalog and Full Text Search on a database.Full Text Index helps to perform complex queries against character data. These queries can include word or […]

link hover image

Asp.Net Enter Key to submit form

Frontpage calendar image June 6, 2014

If you want to press/click submit button on Enter key press to achieve this functionality we need to set “Defaultbutton” property either in Form or in panel. Example in Form: < form id="Myform"> < asp:TextBox ID=”txtUsername” runat=”server”/> < asp:TextBox ID=”txtPassword” runat=”server”/> < asp:Button ID=”btnClick” runat=”server” OnClick=”btnSubmit _Click” Text=”Click”/> < /form> Important We specify the defaultbutton […]

link hover image

ASP.NET Validate ListBox and DropDown List using

Frontpage calendar image June 6, 2014

If you need to validate ListBox and DropDown List you can do it using Required field validator. Sample for ListBox: < asp:ListBox ID="lstboxColors" runat="server" Width="300px" SelectionMode="Multiple"> < asp:ListItem Value="1">Red< /asp:ListItem> < asp:ListItem Value="2">Blue< /asp:ListItem> < asp:ListItem Value="3">Yellow< /asp:ListItem> < asp:ListItem Value="4">Black< /asp:ListItem> < asp:ListItem Value="5">Purple< /asp:ListItem> < asp:ListItem Value="6">White< /asp:ListItem> < /asp:ListBox> < asp:RequiredFieldValidator ID="RequiredFieldValidator1" […]

link hover image

document.getElementById(‘id’).value failing in ASP.net javascript function

Frontpage calendar image May 10, 2014

When you place runat=”server” in an standard HTML tag, ASP.Net mangles the ID to ensure that it’s unique (just like it does with its own controls). You need to access the element using the ID that ASP.Net assigned. Try this: Hidden fields: < input id=”hidOrg1″ type=”hidden” value=”” / > < input id=”hidBT” type=”hidden” value=”” / […]

link hover image

How to disable postback on an asp Button

Frontpage calendar image May 10, 2014

How to disable postback on an asp Button: < asp:button runat="server".... OnClientClick="myfunction(); return false;" / >

link hover image

Frontpage calendar image April 22, 2014

link hover image

How to Be Healthy: Exercise several times a week.

Frontpage calendar image April 22, 2014

Q: How to Be Healthy? A: Exercise several times a week.