Tags » Mvc4

User control in MVC4 for showing Suceess and Error Message

/*paste Code on view where you want to display Message Generally I prefer it on top of the View */

@if (Session["errorMessage"] != null)
{ 196 more words


Passing parameter to store procedure using command parameter in MVC4

public DataTable getEdgingReport(DateTime date)
DataTable dt;
DataSet ds = new DataSet();
SqlCommand cmd = new SqlCommand(“SpFpcGenerateEdgingReport”, con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@rights_fromdate”, DateTime.Now);
cmd.Parameters.AddWithValue(“@rights_todate”, date); 47 more words


Dynamically deciding where clause of the store procedure

ALTER procedure .
@ProgramId varchar(10) =null
, @BuyerId varchar(10) = null
, @SellerId varchar(10) = null
, @rights_fromdate datetime=null
, @rights_todate datetime=null… 273 more words


Mail sending in c#

This post shows how to send mail through c# code. Here we stored all the parameter required for mail send like Subject, From Address, To address, HOST and all other into the web.config file. 229 more words


Jquery UI Popup in MVC4 application

/follwing div will be opened into POPUP window same as above Add following Script file jquery-ui and css files for the same/

@Html.TextBox(“RightName”, null, new { id=”rightName”}) 25 more words


Delete Listbox selected Items using Jquery

/*On button click delete ListBox selected Item here @btnDeleteIncluded is delete button Id and #IncludedList is listbox Id */
$(“#btnDeleteIncluded”).click(function () {


Disable Submit button until form gets submit

Following code disables the Submit button until form gets submit successfully. This is necessary because user may click more than once on submit button and the same data may be processed more than once. 69 more words