Search Results

Search found 85 results on 4 pages for 'mazhar'.

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

  • asp.net mvc json open dialog box problem

    - by mazhar kaunain baig
    function postForm() { $.ajax({ type: "POST", data: $("#myForm").serialize(), dataType: "json", url: '<%= Url.Action("JSONRequest","Home") %>', success: function(result) { window.alert(result.name); }, error : function() { window.alert('error'); } }); } Html.BeginForm("JSONRequest", "Home", FormMethod.Post, new { id = "myForm" }); Html.TextBox("mazhar") <input type="submit" onclick="postForm" /> Html.EndForm(); public ActionResult JSONRequest(FormCollection form) { string a = form["mazhar"]; var data = new { name = "aaaa", Success = "Record is Succesfully Saved", ErrorMessages = "abc" }; return Json(data); } Ok the problem is that the dialog box is opening after running this code which is asking to save file. Can someone tell me how to resolve this issue?

    Read the article

  • Cannot remove an entity that has not been attached on delete

    - by mazhar
    public IQueryable<Feature> GetAllFeaturesByLinkAndParentID(int id) { return from gp in db.Features where gp.int_ParentId == id && gp.bit_IsLink == false select gp; } var DeleteFeature = FeatureRepository.GetAllFeaturesByLinkAndParentID(GetFeatureId); _db.Features.DeleteAllOnSubmit(DeleteFeature); _db.SubmitChanges(); how will i remove the error Cannot remove an entity that has not been attached in this code

    Read the article

  • Using LINQ to SQL in ASP.NET MVC2 project

    - 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 appropriate 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

  • The model item passed into the dictionary is of type 'System.Collections.Generic.Lis

    - by mazhar
    Calling Index view is giving me this very very annoying error . Can anybody tell me what to do about it Error: The model item passed into the dictionary is of type 'System.Collections.Generic.List1[MvcApplication13.Models.Groups]', but this dictionary requires a model item of type 'MvcApplication13.Helpers.PaginatedList1[MvcApplication13.Models.Groups]'. public ActionResult Index(int? page) { const int pageSize = 10; var group =from p in _db.Groups orderby p.int_GroupId select p; var paginatedGroup = group.Skip((page ?? 0) * pageSize).Take(pageSize).ToList(); return View(paginatedGroup); } View: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" % Index <h2>Index</h2> <table> <tr> <th></th> <th> int_GroupId </th> <th> vcr_GroupName </th> <th> txt_GroupDescription </th> <th> bit_Is_Deletable </th> <th> bit_Active </th> <th> int_CreatedBy </th> <th> dtm_CreatedDate </th> <th> int_ModifiedBy </th> <th> dtm_ModifiedDate </th> </tr> <% foreach (var item in Model) { %> <tr> <td> <%= Html.ActionLink("Edit", "Edit", new { id=item.int_GroupId }) %> | <%= Html.ActionLink("Details", "Details", new { id=item.int_GroupId })%> | <%= Html.ActionLink("Delete", "Delete", new { id=item.int_GroupId })%> </td> <td> <%= Html.Encode(item.int_GroupId) %> </td> <td> <%= Html.Encode(item.vcr_GroupName) %> </td> <td> <%= Html.Encode(item.txt_GroupDescription) %> </td> <td> <%= Html.Encode(item.bit_Is_Deletable) %> </td> <td> <%= Html.Encode(item.bit_Active) %> </td> <td> <%= Html.Encode(item.int_CreatedBy) %> </td> <td> <%= Html.Encode(String.Format("{0:g}", item.dtm_CreatedDate)) %> </td> <td> <%= Html.Encode(item.int_ModifiedBy) %> </td> <td> <%= Html.Encode(String.Format("{0:g}", item.dtm_ModifiedDate)) %> </td> </tr> <% } %> </table> <% if (Model.HasPreviousPage) { % <%= Html.RouteLink("<<<", "UpcomingDinners", new { page = (Model.PageIndex-1) }) % <% } % <% if (Model.HasNextPage) { % <%= Html.RouteLink("", "UpcomingDinners", new { page = (Model.PageIndex + 1) }) % <% } % <p> <%= Html.ActionLink("Create New", "Create") %> </p>

    Read the article

  • asp.net mvc making ajax call jason

    - by mazhar kaunain baig
    Controller: public ActionResult EditOrganizationMeta(int id) { } [HttpPost] [ValidateInput(false)] public ActionResult EditOrganizationMeta(FormCollection collection) { } View: function DoAjaxCall() { var url = '<%= Url.Action("EditOrganizationMeta", "Organization") %>'; //url = url + '/' + dd; $.post(url, null, function(data) { alert(data); }); } <input type="button" name="something" value="Save" onclick="DoAjaxCall()" /> how would i make the ajax call , i have basically two functions with the same name EditOrganizationMeta,Do the form collection will be passed automatically.Basic confusion is regarding the method call Ok i made a call by ajax but after that My This code is not running anymore [HttpPost] [ValidateInput(false)] public ActionResult EditOrganizationMeta(FormCollection collection) { int OrganizationId = 11; string OrganizationName = "Ministry of Interior"; try { string ids = Request.Params // **getting error here some sequence is not there** .Cast<string>() .Where(p => p.StartsWith("button")) .Select(p => p.Substring("button".Length)) .First(); String RealValueOfThatControl = collection[ids]; } } catch { } return RedirectToAction("EditOrganizationMeta", new { id = OrganizationId }); } I think that there is no post

    Read the article

  • asp.net mvc tree view with checkbox

    - by mazhar
    Ok I am looking for a solution in mvc2 where i can have tree view generated where after that i can checked the nodes I want to enter the value in the database. Can anyone point me to something? Basically I am assigning features to a particular group.(I have a group admin whom I can assign the manage user add edit delete,manage groups delete,manage teacher add edit feature Can someone point me to some other technique that i can implement?

    Read the article

  • asp.net mvc jquery removing select list item

    - by mazhar kaunain baig
    $('#remove').click(function() { var foo = []; $('#FeatureLists :selected').each(function(i, selected) { foo[i] = $(selected).text(); alert(foo[i]); if (foo[i] != "Add" ) return !$('#FeatureLists option:selected').remove(); if (foo[i] != "Edit") return !$('#FeatureLists option:selected').remove(); }); }); i have six items in my select in which 4 of them are add,edit ,delete view, it is multiselect list, i don't want the user to remove the these 4 items , apart from that they can remove any item. how will i do that? it is not happening in the above code

    Read the article

  • dataannotation metadatatype register dll in global.aspx (linq to sql)

    - by mazhar
    I am trying to use dataannotation validation(I am not able to Fire the annotations as yet) in my mvc application. with reference to this article I want to confirm http://www.asp.net/mvc/tutorials/validation-with-the-data-annotation-validators-cs I am using vs 2008 professional edition . Do I really need to download Microsoft.web.mvc.dataannotation dll (The other dll is already present in the vs). to use(fire) datannotation on the page.? I am using partial views as well on the pages with dataviewmodel class(I will be using formviewmodel class for validation?)

    Read the article

  • asp.net mvc ajax

    - by mazhar kaunain baig
    <% using (Ajax.BeginForm("EditOrganizationMeta", new AjaxOptions { UpdateTargetId = "\<%= OrganizationMeta.vcr_MetaKey + Lang.int_LangId%>" })) { %> i want to specify name after UpdateTargetid ,how will i do that?

    Read the article

  • asp.net mvc asp.net

    - by mazhar
    I want to Develop a similar sort of wizard mechanism for the design like in the picture above .How would I do that. Please reply how would i code the above mechanism . At this time I am completely blank so any idea will be great.

    Read the article

  • An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

    - by mazhar
    Ok the thing is that I am using asp.net mvc with linq to sql. I have a scenario where there are two tables group and features with many to many relationship with the third table groupfeatures. I have drag and drop all three table in the dbml file. The thing is that it runs fine with group but when I call the Feature things the above error occured and the compilers stops at this line in ((())). public partial class EgovtDataContext : System.Data.Linq.DataContext { private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource(); #region Extensibility Method Definitions partial void OnCreated(); partial void InsertGroup(Group instance); partial void UpdateGroup(Group instance); partial void DeleteGroup(Group instance); partial void InsertFeature(Feature instance); partial void UpdateFeature(Feature instance); partial void DeleteFeature(Feature instance); partial void InsertGroupFeature(GroupFeature instance); partial void UpdateGroupFeature(GroupFeature instance); partial void DeleteGroupFeature(GroupFeature instance); #endregion (((public EgovtDataContext() : base(global::System.Configuration.ConfigurationManager.ConnectionStrings["egovtsConnectionString"].ConnectionString, mappingSource)))) The code in both the controller Group and features file is ditto copied. Note the group things are working, the features things are not. FeaturesRepository.cs public IQueryable<Feature> FindAllFeatures() { return db.Features; } FeaturesController.cs FeaturesRepository FeatureRepository = new FeaturesRepository(); public ActionResult Index() { var Feature = FeatureRepository.FindAllFeatures(); return View(Feature); } So what could be wrong?

    Read the article

  • 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

1 2 3 4  | Next Page >