Solution var val="abc"; $("#dropdown > [value=" + val + "]").attr("selected", "true");
Visual Studio during Debugging: The function evaluation requires all threads to run
Cause This isn't an error in and of itself, but more of a feature of your debugger. Some properties require code to be executed so that the property can be read, but if this requires cross-thread interaction, then other threads may have to run as well. The debugger doesn't do this automatically, but certainly can,... Continue Reading →
Hashing Passwords-Easier Password Management by creating and storing the salt and the hashed password in a single value.
Include header using System.Web.Helpers; In View: To take input <div class="col-sm-4 tb-font"> @Html.Label("UName", "User Name", new { style = "width:140px; margin-bottom:5px; margin-top:5px; float: left;" }) @Html.TextBox("UserName", null, new { @class = "form-control text-box" }) </div> <div class="col-sm-4 tb-font"> @Html.Label("Pswrd", "Password", new { style = "width:140px; margin-bottom:5px; margin-top:5px; float: left;" }) @Html.Password("Password", null, new { @class... Continue Reading →
Set selected value as empty for dropdownlist via jquery
Solution $("#elementId").val(''); e.g. $("#ddlMain").val('');
MetadataException: Unable to load the specified metadata resource
Causes This means that the application is unable to load the EDMX. Your connection string might be wrong. you might not have changed it, but if you have changed other things (say, the name of an assembly), it could still be wrong. You might be using a post-compile task to embed the EDMX in the... Continue Reading →
Object reference not set to an instance of the object
Solution This exception occurs when you try to insert null value into a not null column in DB e.g in primary key column or any other not null column. Insert the value in that column and the issue will be resolved 🙂
Disabling a text-box in ajax ASP.NET
Solution document.getElementById("myText").disabled = true;
Return bool value from ajax
Returning bool value from ajax is not similar to any simple function that returns the bool value. BUT DON'T WORRY! it isn't even too difficult. it's just slightly different. Solution var alreadyExists = function () { var role = $("#UserRole").val(); var notexists = false; $.ajax ({ url: "@(Url.Action("checkExists", "UserManagement"))", data: { role: role }, contentType:... Continue Reading →
Get Value(s) from one table and Insert into column of another or same table
Solution INSERT INTO destination_table (column names ) (select column names from the source_table ); e.g. INSERT INTO [dbo].[t_Menu] (Name,ParentId)VALUES ('CustomizedReports',(select id from t_Menu where Name='Reports')) go Explanation Here I have inserted the value in the same table, you can write name of the other table in select statement if you want to get from other... Continue Reading →
StoredProcedureName_Result not found
Solution If your stored procedure i returning just a column or more than 1 columns and not returning the ID column that is the primary key, this error would occur. Just include ID or * in select statement e.g. ALTER PROCEDURE [dbo].[sp_FillMenuItems] AS BEGIN SELECT * from t_Menu End OR ALTER PROCEDURE [dbo].[sp_FillMenuItems] AS BEGIN... Continue Reading →