Search Results

Search found 94 results on 4 pages for 'mazhar kaunain baig'.

Page 3/4 | < Previous Page | 1 2 3 4  | Next Page >

  • asp.net mvc formcollection

    - by mazhar
    public ActionResult Edit(int id, FormCollection formValues) { 07. 08. // Retrieve existing dinner 09. Dinner dinner = dinnerRepository.GetDinner(id); 10. 11. // Update dinner with form posted values 12. dinner.Title = Request.Form["Title"]; 13. dinner.Description = Request.Form["Description"]; 14. dinner.EventDate = DateTime.Parse(Request.Form["EventDate"]); 15. dinner.Address = Request.Form["Address"]; 16. dinner.Country = Request.Form["Country"]; 17. dinner.ContactPhone = Request.Form["ContactPhone"]; 18. 19. // Persist changes back to database 20. dinnerRepository.Save(); 21. 22. // Perform HTTP redirect to details page for the saved Dinner 23. return RedirectToAction("Details", new { id = dinner.DinnerID }); 24.} formValues is not used in any form, what is the used of it.

    Read the article

  • JQuery toggle problem

    - by Mazhar Ahmed
    I'm using JQuery. I'm writing this as HTML code: <li id="toggle"> <a id="open" class="open" href="#">Log In | Register</a> <a id="close" class="close" style="display: none;" href="#">Close Panel</a> </li> and I'm writing a code like that: $(document).ready(function() { // Expand Panel $("#open").click(function(){ $("div#panel").slideDown("slow"); }); // Collapse Panel $("#close").click(function(){ $("div#panel").slideUp("slow"); }); // Switch buttons from "Log In | Register" to "Close Panel" on click $("#toggle a").click(function () { $("#toggle a").toggle(); }); }); They problem is that, it's working in a file. And after that I copied in in another file and it will not working. There is no duplicate ID or anything else in the document

    Read the article

  • jquery jstree or dynatree parent node don't get selected

    - by mazhar
    I have used jquery jstree or dynatree using check boxes and found the same logic The thing is that the if for example there is a parent and 4 child. a) i select all the 4 child (parent get auto selected) the 4 child and the parent node id get posted to the controller. b) But if i select less then 4 children (parent get auto selected) only child node ids get posted to the controller. Is there any way even if i select less then 4 children all my selected nodes included the parent get posted to the controller?

    Read the article

  • using linq to sql

    - by mazhar
    Well I am new to this orm stuff. We have to create a large project . I read about linq to sql . will it be appropiate to use it in the project of high risk . i found no problem with it personally but the thing is that there will be no going back once started.So i need some feedback from the orm gurus here at the msdn.Will entity framework will be better?( I am in doubt about link to sql because I have read and heard negative feedback here and there) I will be using mvc2 as the framework. So please give the feedback about linq to sql in this regard. q2) Also I am a fan of stored procedure as they are precomputed and fasten up the thing and I have never worked without them.I know that linq to sql support stored procedures but will it be feasible to give up stored procedure seeing the beautiful data access layer generated with little effort as we are also in a need of rapid development. q3) If some changes to some fields required in the database in Link to Sql how will the changes be accommodated in the data access layer.

    Read the article

  • asp.net mvc user control problem foreach loop

    - by mazhar
    Previous post <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" % <% MvcApplication1.Models.FeaturesRepository _model = new MvcApplication1.Models.FeaturesRepository(); % <% foreach (var md in _model.GetAllFeatures()) { % <%--<% if (md.int_ParentId == 0) { %--% <%= md.vcr_FeaturesName % <%--<% } %--% <% } % It is with reference to the previous post above.Is there something wrong with the foreach loop(The result is correct but it is displaying the series of Add,Add,Add,Add,Add,Add...,which is the last record of the getallfeatures.

    Read the article

  • Cannot add an entity that already exists.

    - by mazhar
    Code: public ActionResult Create(Group group) { if (ModelState.IsValid) { group.int_CreatedBy = 1; group.dtm_CreatedDate = DateTime.Now; var Groups = Request["Groups"]; int GroupId = 0; GroupFeature GroupFeature=new GroupFeature(); foreach (var GroupIdd in Groups) { // GroupId = int.Parse(GroupIdd.ToString()); } var Features = Request["Features"]; int FeatureId = 0; int t = 0; int ids=0; string[] Feature = Features.Split(',').ToArray(); //foreach (var FeatureIdd in Features) for(int i=0; i<Feature.Length; i++) { if (int.TryParse(Feature[i].ToString(), out ids)) { GroupFeature.int_GroupId = 35; GroupFeature.int_FeaturesId = ids; if (ids != 0) { GroupFeatureRepository.Add(GroupFeature); GroupFeatureRepository.Save(); } } } return RedirectToAction("Details", new { id = group.int_GroupId }); } return View(); } I am getting an error here Cannot add an entity that already exists. at this line GroupFeatureRepository.Add(GroupFeature); GroupFeatureRepository.Save();

    Read the article

  • using 3rd party dll in enterprise web based application?

    - by mazhar
    I found a great control with example here for mvc It fulfills all my requirement but the problem is that it uses a js tree dll. Should I go on and used that example in my application? Do you people refrain from using 3rd party free dll in applications? How will I tell that it will not expire or not cause problem later on Forgive me if this is inappropriate question but thx in advance for any appropiate reply on this topic. just trying to get the point of view of you people on this

    Read the article

  • asp.net mvc DataViewModel Problem no insert and edit

    - by mazhar
    using the code DataViewModel with one form for create and edit with partial view , in the code below In the create*I am not able to enter the values to the database*,In the edit Mode I am not able to display the value as well in the textboxes for edit public class OrganizationGroupFormViewModel { // Properties public OrganizationGroup OrganizationGroup { get; private set; } public OrganizationGroupFormViewModel(OrganizationGroup organizationGroup) { OrganizationGroup = organizationGroup; } } public class OrganizationGroupsController : Controller { // // GET: /OrganizationGroups/ OrganizationGroupsRepository OrganizationGroupRepository = new OrganizationGroupsRepository(); OrganizationUsersDataContext _db = new OrganizationUsersDataContext(); public ActionResult Create() { try { OrganizationGroup OrgGroup = new OrganizationGroup() { int_CreatedBy=1, dtm_CreatedDate=DateTime.Now }; return View(new OrganizationGroupFormViewModel(OrgGroup)); } catch { return View(); } } [HttpPost] public ActionResult Create(OrganizationGroup OrgGroup) { if (ModelState.IsValid) { OrgGroup.int_CreatedBy = 1; OrgGroup.dtm_CreatedDate = DateTime.Now; OrganizationGroupRepository.Add(OrgGroup); OrganizationGroupRepository.Save(); return RedirectToAction("Details", new { id = OrganizationGroupRepository.int_OrganizationGroupId }); } return View(new OrganizationGroupFormViewModel(OrgGroup)); } // // GET: /OrganizationGroups/Edit/5 public ActionResult Edit(int id) { try { var OrgGroup = _db.OrganizationGroups.First(m => m.int_OrganizationGroupId == id); if (ModelState.IsValid) { OrgGroup.int_ModifiedBy = 1; OrgGroup.dtm_ModifiedDate = DateTime.Now; } return View(new OrganizationGroupFormViewModel(OrgGroup)); } catch { return View(); } } // // POST: /OrganizationGroups/Edit/5 [HttpPost] public ActionResult Edit(int id, FormCollection collection) { try { var OrgGroup = _db.OrganizationGroups.First(m => m.int_OrganizationGroupId == id); if (ModelState.IsValid) { OrgGroup.int_ModifiedBy = 1; OrgGroup.dtm_ModifiedDate = DateTime.Now; TryUpdateModel(OrgGroup); OrganizationGroupRepository.Save(); } return RedirectToAction("Details", new { id = OrgGroup.int_OrganizationGroupId }); } catch { return View(); } } Create View; <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Egovst.Controllers.OrganizationGroupFormViewModel>" %> Create Organization Group <h2>Create</h2> <%= Html.ValidationSummary(true) %> <div> <% Html.RenderPartial("OrganizationGroup"); %> </div> Organization Group User Control <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Egovst.Controllers.OrganizationGroupFormViewModel>" %> <% using (Html.BeginForm()) {%> <%= Html.ValidationSummary(true) %> <fieldset> <legend>Fields</legend> <div class="editor-label"> Organization Group Name: </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.OrganizationGroup.vcr_OrganizationGroupName)%> <%= Html.ValidationMessageFor(model => model.OrganizationGroup.vcr_OrganizationGroupName)%> </div> <div class="editor-label"> Organization Group Description: </div> <div class="editor-field"> <%= Html.TextAreaFor(model => model.OrganizationGroup.vcr_OrganizationGroupDesc)%> <%= Html.ValidationMessageFor(model => model.OrganizationGroup.vcr_OrganizationGroupDesc)%> </div> <p> <input type="submit" value="Save" /> </p> </fieldset> <% } %>

    Read the article

  • asp.net viewdata

    - by mazhar
    public ActionResult AddDinner() { Dinner dinner = dinnerRepository.GetDinner(id); ViewData["dinner"] = repository.AllDinners(); return View(dinner); } 1) First of all both the dinner object and the ViewData["dinner"] is passing to the view? 2) Secondly how would I iterate over the ViewData["dinner"] in the view?

    Read the article

  • asp.net mvc select list

    - by mazhar
    ok what i want to do is to using forcollection["Selectlist"] only selected things in the select list will be availabe when the form posted i am using add ,remove mechanism in my listbox , so i want to make everything that is there in the checkbox as available to the forcollection["Selectlist"]. can it be done?

    Read the article

  • asp.net mvc checkbox hierarchy

    - by mazhar
    I want to create a checkboxes hierarchy like this in mvc2.How would I be able to achieve this in the most simplest manner. Administrator Manage User Add Edit Delete View Manage Feature Add Edit Delete View Moderator Manage User Add Edit Delete View Manage Feature Add Edit Delete View

    Read the article

  • difference between mvc1 and mvc2

    - by mazhar
    q1) what is difference between mvc1 and mvc2 ? q2) everything that is in mvc1 is in mvc2?I am asking this question because there is a debate in my place of work as we can find many resources and ebooks on mvc1 not mvc2 so we should use mvc1 in our portal. q3) same ajax functionality can be implemented in web forms as well as in mvc or mvc2. or there is some limition in mvc?

    Read the article

  • jquery adding in select list by textbox

    - by mazhar
    ok what i am trying to do is to add something in the textbox and after pressing the add button it should go into the select list. how would i do that with jquery? I am not really able to make it work by your method .Please help? What i am doing wrong <%= Html.ListBox("FeatureLists", ViewData["FeatureListListBox"] as MultiSelectList)% $("#add").click(function() { var val = $("#txtaddfeature").val(); alert("aaa"); $("", { 'value': val, text: val }).appendTo("#FeatureLists"); //$("#textbox").val(''); here if you want to clear the value for next time });

    Read the article

< Previous Page | 1 2 3 4  | Next Page >