Posts

Add New column with foreign key using ms sql server

alter table [dbo].[Master_Tour] add PackageId int CONSTRAINT fk_master_tour_master_package FOREIGN KEY (PackageId) REFERENCES master_package(PackageId) 

Fill Drop down List Using VIew Model in MVC

=================== view model start =====================  public class TourMaster_SubCategoryViewModel     {         public int SubCategoryId { get; set; }         [Display(Name = "Category")]         [Required(ErrorMessage = "Please select category")]         public int CategoryId { get; set; };         public IEnumerable<TourMaster_CategoryViewModel> Categories { get; set; }         [Display(Name = "Sub category name")]         public string Name { get; set; }         [Display(Name = "Category name")]    } =================== view model end ===================== =================== CONTROLLER START (page load) =====================  public ActionResult subcategorydetails(int? vbgid)         {         ...

Fill Customize Drop down List in MVC

If you are using MVC Model to bind data, but you want to customize fill drop down . Use the below example =============================== @Html.DropDownListFor(x => x.PV, new List<SelectListItem> {       new SelectListItem() {Text = "10", Value="10"},       new SelectListItem() {Text = "20", Value="20"}, }, new { @class = "form-control", }) ===============================

Change Visual Studio Code Explorer Size

Change Visual Studio Code Explorer Size Go to FILE => Preferences => Settings =>  Find "Workbranch" under User Tab => Find "Edit in Setting.json"  {      "workbench.colorTheme" :  "Monokai" ,      "editor.fontSize" :  13 ,      "window.zoomLevel" :  1 } window.zoomlevel for solution explorer Size editor.fontsize for editor font size Change according to your need Thanks content reference link:   https://code.visualstudio.com/docs/getstarted/settings

Convert Numeric Value Into Words (Currency) In C#

+++++++++++++++++++++++++ https://code.msdn.microsoft.com/windowsdesktop/Convert-Numeric-Value-Into-db70224e +++++++++++++++++++++++++ also good article for interview or learning deep about asp.net web forms +++++++++++++++++++++++++ https://www.c-sharpcorner.com/UploadFile/1492b1/C-Sharp-and-Asp-Net-question-and-answersall-in-one/ +++++++++++++++++++++++++

What event handlers can I include in Global.asax?

What event handlers can I include in Global.asax? Application_Start, Application_End,  Application_AcquireRequestState, Application_AuthenticateRequest, Application_AuthorizeRequest, Application_BeginRequest, Application_Disposed,  Application_EndRequest,  Application_Error, Application_PostRequestHandlerExecute, Application_PreRequestHandlerExecute,  Application_PreSendRequestContent, Application_PreSendRequestHeaders,  Application_ReleaseRequestState, Application_ResolveRequestCache, Application_UpdateRequestCache, Session_Start  and Session_End.

Insert and Get value multi checkbox box list using MVC 5

Insert and Get value multi checkbox box list using MVC 5 [HTTPGET] =========================  [HttpGet]         public ActionResult UserProfile()     // Show form data page load time         {             ProfileViewModel obj = new ProfileViewModel();             string username = Convert.ToString(Session["Username"]);             SignUp objsignup = db.signUp.Where(x => x.Username == username).FirstOrDefault();  List<Hobbies> objSelectedHobbies = FillHobbies();             if (!string.IsNullOrEmpty(objsignup.Hobbies))             {                             string s = objsignup.Hobbies;                 string[] values = s.Split(','); ...