Search Results

Search found 346 results on 14 pages for 'mazhar ahmed'.

Page 4/14 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | 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

  • asp.net mvc json 2 times post to the controller

    - by mazhar kaunain baig
    function onTestComplete(content) { var url = '<%= Url.Action("JsonTest","Organization") %>'; $.post(url, null, function(data) { alert(data["name"]); alert(data["ee"]); }); } <% using (Ajax.BeginForm("JsonTest", new AjaxOptions() { HttpMethod = "POST", OnComplete = "onTestComplete" })) { %> <%= Html.TextBox("name") %><br /> <input type="submit" /> <% } % controller:` [HttpPost] public ActionResult JsonTest() { var data = new { name = "TestName",ee="aaa" }; return Json(data); }` Due to some reason When I click on the button (My Break point is in the controller jsontest method) The jsontest is called twice(that's the real problem).I want to call it once as usual,using Ajax.BeginForm( "", new AjaxOptions { HttpMethod = "POST", OnComplete = "onTestComplete" })) I am able to call it once but it doesn't post the values to the controller.

    Read the article

  • asp.net mvc2 ajax.actionlink is not working refresh problem

    - by mazhar kaunain baig
    has someone make ajax.actionlink for delete to work properly.After deleting the record successfully at the end it is not refreshing the page properly. the page refresh is my problem. i have defined the updatetarget id and returning view(model) from my controller but it is returning the master page with it. So the thing is that i am having a page with a page.I have used redirect as well which is not refreshing, <%= Ajax.ActionLink("Delete", "Delete", new { id = item.int_OrganizationGroupId }, new AjaxOptions { UpdateTargetId = "abc", HttpMethod = "Post", Confirm = "Delete Group with Organization Group ID:" + item.int_OrganizationGroupId + " Organization Group Name:" + item.vcr_OrganizationGroupName, OnSuccess = "handleSuccess" })%>| abc is the id of the table From controller View("ManageGroup,Model);

    Read the article

  • asp.net mvc viewdata

    - by mazhar kaunain baig
    <% foreach (var Lang in ((IEnumerable<Egovt.Models.Language>)ViewData["Languages"])) { %> <div id="tabs-<%=Html.Encode(Lang.int_LangId) %>"> <% foreach (var OrganizationMeta in ((IEnumerable<Egovt.Models.OrganizationMeta>)ViewData["OrganizationMeta"])) { %> <% if (OrganizationMeta.vcr_DateType == "text") { %> <%=Server.HtmlDecode(OrganizationMeta.vcr_MetaValue)%><br /> <a href="#"></a> <% } else if (OrganizationMeta.vcr_DateType == "file") { %> <img alt="Image" src="../../Content/Logo/dd.gif" /> <% } %> <% } %> </div> <% } %> I want to base my second loop on the basis of first loop on the langid field, there are many ways but what you guys will use

    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

  • asp.net mvc making delete usercontrol information passing on and off

    - by mazhar kaunain baig
    i am creating a generalize deleteusercontrol , my aim is that on the listing page where all the records are listed when the delete is pressed i want to display the acknowledgment on the same page up the list. I had little idea to do that q1) first of all where will i place my deleteusercontrol(in the shared folder?). q2) on and off the deleteusercontrol as the acknowledgment will not be there all the time how would i be doing that on delete press. i don't want to pass any data in the querystring. q3)how would i be passing the records list id and listname to the general deleteusercontrol as it would be same for all the listing

    Read the article

  • ASP.NET MVC AJAX value not displaying

    - by mazhar kaunain baig
    View: function success(arg) { var obj = arg.get_response().get_object(); if (obj.ErrorMessage === '') { var answer = document.createElement('div'); answer.appendChild(document.createTextNode(obj.Answer)); document.getElementById('answers').appendChild(answer); } else { document.getElementById('errors').innerHTML = obj.ErrorMessage; } } <% using (Ajax.BeginForm("EditOrganizationMeta", "Organization", new AjaxOptions { HttpMethod = "POST", OnSuccess = "success" })) { %> <input type="submit" name="button<%=OrganizationMeta.vcr_MetaKey + Lang.int_LangId %>" value="Save" /> <div id="errors"></div> <div id="answers"></div> <% } %> Controller: [HttpPost] [ValidateInput(false)] public ActionResult EditOrganizationMeta(FormCollection collection) { return Json(new { Answer = "Record Successfully Saved", ErrorMessages = "Title is required" }); } The thing is that success method in the javascript is not getting the required parameters. It is printing undefined there. Is there a problem in javascript method OnSuccess?

    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

  • asp.net mvc select change redirect to Action

    - by mazhar kaunain baig
    I am correctly passing the action name from the Controller to the paging class and then using select list i want to redirect to that action. at this moment it is appending to the current url.i want the correct way of redirecting to the controller action manageUser using select list below What should we have here in Model.COntroller . ControllerName/ActionName/ or Just ActionName <select id="paging" onchange="location.href='<%= Model.Controller %>'+this.value"> <% for (int i = 1; i <= Model.TotalPages; i++) { %> <option id=<%=i %>><%=i %></option> <% } %> </select> public class PaginatedList<T> : List<T> { public string Controller { get; private set; } public PaginatedList(IQueryable<T> source, int pageIndex, int pageSize,string Cont) { Controller = Cont; // here is the controller } } Controller public ActionResult ManageUser(int? page) { const int pageSize = 5; var AllUser = UserRepository.GetAllUser(); var paginatedUsers = new PaginatedList<Users>(AllUser, page ?? 1, pageSize,"ManageUser/Page/"); return View(paginatedUsers); }

    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

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >