Search Results

Search found 71 results on 3 pages for 'user281180'.

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

  • How to validate the following

    - by user281180
    I have the following code <% using(Ajax.BeginForm("UpdatePassword", new AjaxOptions{UpdateTargetId="Password"})) { %> <div id="Password"> <table> <tr> <td>New password</td><td><%=Html.Password("newPassword") %></td> </tr> <tr> <td>Confirm new password</td> <td><%=Html.Password("confirmPassword")%><%= Html.ValidationMessage("confirmPassword") %> </td> </tr> </table> <% } % Can someone help me how to proceed to validating that the confirmPassword is equal the new password, and if not the message is displayed in the html.validationMessage()...

    Read the article

  • How to write simple code in LInq

    - by user281180
    I have the following in my NotSelectedList. public List<TestModel> SelectedList = new List<TestModel>(); public List<TestModel>NotSelectedList = new List<TestModel>(); NotificationDetailsModel projects = new NotificationDetailsModel(); projects.ProjectID = Convert.ToInt32(Row["ProjectID"]); projects.Valid= Convert.ToBoolean(Row["Validity"]); NotSelectedList.Add(projects); How can I write a simple code in LINQ to select from the NotSelectedList where Validity == True and store the data in SelectedList?

    Read the article

  • routing difficulty

    - by user281180
    Part of my application maps resources stored in a number of locations onto web URLs like this: http://servername/Issue.aspx/Details?issueID=1504/productId=2345 Is it possible to construct an MVC route that matches this so that I get the path in its entirety passed into my controller? Either as a single string or possibly as an params style array of strings. In my Global.aspx I have routes.MapRoute( "Issue", "Issue/{Details}", new { controller = "Issue", action = "Details" }, new { issueId = @"\d+", productId = @"\d+" } ); I have tried the code RouteValueDictionary parameters = new RouteValueDictionary { {"Controller", "Issue"},{ "action", "Details" }, { "issueId", Test.ID }, {"productId", Test.Project.ID} }; VirtualPathData vpd = RouteTable.Routes.GetVirtualPath(null, parameters); var test = vpd.VirtualPath; test value is /Issue.aspx/Details?issueId=1504&productId=3625. How to generate URLs Using ASP.NET Routing and sends it to users and they should be able to open the page by clicking on the generated link. However, here the servername isn`t included. How can I have the servername with the the link as http://servername/Issue.aspx/Details?issueID=1504/productId=2345

    Read the article

  • How to read textarea with certain condition

    - by user281180
    I have a textarea in which the user enters the following data: Paul:Nine, Rome Jenny:Five, India Bob I want to read the data and store the values before the colon in an array and the values after the colon in another array. Please note that the user may not enter values after the colon like in case 3 above. In such case, the value must be stored in the first array as if it is before the colon. How can I do that using jquery?

    Read the article

  • Model binding difficulty

    - by user281180
    I am having a model and I am using ajax.post. I can see that the model binding isn`t being done for the arraylists in my model, though binding done for the properties of int or string type. Why is that so? My code is as below. I have a model with the following properties public class ProjectModel { public int ID { get; set; } public ArrayList Boys= new ArrayList(); } In my view I have $(document).ready(function () { var project = new Object(); var Boys= new Array(); var ID; ....... ID = $('#ID').val(); project.Boys= Boys; ..... $.ajax({ type: "POST", url: '<%=Url.Action("Create","Project") %>', data: JSON.stringify(project), contentType: "application/json; charset=utf-8", dataType: "html", success: function () { }, error: function (request, status, error) { } }); // My controller [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(ProjectModel project) { try { project.CreateProject(); return RedirectToAction("Index"); } ....

    Read the article

  • How to read modelstate errors when returned by Json?

    - by user281180
    How can I display modelstate errors returned by Json ? I want to do somthing like that... if (!ValidateLogOn(Name, currentPassword)) { ModelState.AddModelError("_FORM", "Username or password is incorrect."); //Return a json object to the javascript return Json(new { ModelState }); } What must be my code in the view to read the modelstate errors and display them? My actual code in the view is as follows to read the Json values: function createCategoryComplete(e) { var obj = e.get_object(); alert(obj.Values); }

    Read the article

  • How to merge after reverting in mercurial?

    - by user281180
    I have had a bad merge. Now I want to start the merge all over again. I did a revert just before the merge. Now when im trying to add the bundle , im having the message and it can no more locate the changes. What is wrong? Why isn`t it finding any change? c:\Documents and Settings\Shamima\Desktop\New Folder\test_rev94_to_tip_hg\test_rev94_to_tip.hg searching for changes no changes found [command completed successfully Tue Apr 13 16:10:37 2010]

    Read the article

  • Advanced Model Binding vs 2010

    - by user281180
    Can I have an example of advanced model binding using ajaxpost? I have two classes Person and Test as follows: public class person{ public ArrayList Name = new ArrayList(); public Test []test {get;set;} } public class Test { public int ID{get;set;} public int mark{get;set;} } My Controller could be [HttpPost] public EmptyResult CaseTest(Person person) { return new EmptyResult(); } How do I post the values from the view?

    Read the article

  • model binding of non-sequential arrays

    - by user281180
    I am having a table in which i`m dynamically creating and deleting rows. How can I change the code such that the rows be added and deleted and the model info property filled accordingly. Bearing in mind that the rows can be dynamically created and deleted, I may have Info[0], Inf0[3], info[4]... My objective is to be able to bind the array even if it`s not in sequence. Model public class Person { public int[] Size { get; set; } public string[] Name { get; set; } public Info[]info { get; set; } } public class Info { public string Address { get; set; } public string Tel { get; set; } View <script type="text/javascript" language="javascript"> $(function () { var count = 1; $('#AddSize').live('click', function () { $("#divSize").append('</br><input type="text" id="Size" name="Size" value=""/><input type = "button" id="AddSize" value="Add"/>'); }); $('#AddName').live('click', function () { $("#divName").append('</br><input type="text" id="Name" name="Name" value=""/><input type = "button" id="AddName" value="Add"/>'); }); $('#AddRow').live('click', function () { $('#details').append('<tr><td>Address</td><td> <input type="text" name="Info[' + count + '].Address"/></td><td>Tel</td><td><input type="text" name="Info[' + count++ + '].Tel"/></td> <td><input type="button" id="AddRow" value="Add"/> </td></tr>'); }); }); </script> </head> <body> <form id="closeForm" action="<%=Url.Action("Create",new{Action="Create"}) %>" method="post" enctype="multipart/form-data"> <div id="divSize"> <input type="text" name="Size" value=""/> <input type="button" value="Add" id="AddSize" /> </div> <div id="divName"> <input type="text" name="Name" value=""/> <input type="button" value="Add" id="AddName" /> </div> <div id="Tab"> <table id="details"> <tr><td>Address</td><td> <input type="text" name="Info[0].Address"/></td><td>Tel</td><td><input type="text" name="Info[0].Tel"/></td> <td><input type="button" id="AddRow" value="Add"/> </td></tr> </table> </div> <input type="submit" value="Submit" /> </form> </body> } Controller public ActionResult Create(Person person) { return new EmptyResult(); }

    Read the article

  • Confused about technique to use to submit form

    - by user281180
    I have created a view in which i`m using clientsidevalidation. The jquery has a textbox , a table and a submit button. The table is empty at the beginning. Using jquery I populate the table with 2 columns ID and Name. I send the values to the controller using the submit button. My question are as follows: How do I send the values of the texbox and the table to the controller? Any guide please.

    Read the article

  • manipulating string

    - by user281180
    I have a string Paris, UK, Pakistan, China, Madagascar I need to ensure that I hav only names and after the third name I insert ... i.e Paris, UK, Pakistan... How can i do this?

    Read the article

  • dialog box not showing error

    - by user281180
    Hi, I`m having the following error . Why am I having this error and how can I solve it? $("SelectProject").dialog is not a function http://localhost:1419/Customer Line 57 $("#SelectProject").dialog is not a function http://localhost:1419/Customer Line 69 My codes are as follows: $(document).ready(function() { $("#project_link").click(function() { $('SelectProject').dialog('open'); return false; }); $('#SelectProject').dialog({ autoOpen: false, width: 800, position: [130, 200], buttons: { "Cancel": function() { $(this).dialog("close"); }, "Accept": function() { $(this).dialog("close"); } } });

    Read the article

  • How to send and retrieve in the controller

    - by user281180
    I have the folowing code in my view, however, I can see that I don`t have the values in the controller. What is wrong? In the view I have, <% using (Html.BeginForm()) {%> <%=Html.TextBox("Addresses[0].Line1") %> <%=Html.TextBox("Addresses[0].Line2")%> <%=Html.TextBox("Addresses[1].Line1")%> <%=Html.TextBox("Addresses[1].Line2")%> <input type="submit" name="submitForm" value="Save products" /> <% } %> My classes are as follows: public class Customer { public string FirstName { get; set; } public string Lastname { get; set; } public List<Address> Addresses { get; set; } public Customer() { Addresses = new List<Address>(); } } public class Address { public int Line1 { get; set; } public int Line2 { get; set; } } My controller as follows: public ActionResult Index() { return View(); } [HttpPost] public ActionResult Index(Customer customer) { return View(); }

    Read the article

  • checkbox val not showing false

    - by user281180
    I have the follwoing code: $("input:checkbox").live('click', function() { alert($(this).val()); }); True is shown if the checkbox is checked. However, if the checkbox is checked and I uncheck it, the value shown is still true. How can I correct that? What is wrong with the code? Thanks

    Read the article

  • How to reset textbox values in dialog after destroy?

    - by user281180
    I have a dialog in which there are 2 textboxes. I want to reset the textboxes values once the dialog is destroyed. How can I do that? If I have entered values in the textboxes and clicked cancel, reopening the dialog will show the data entered previously. function setDialogWindows($element) { $('#change').dialog({ autoOpen: true, width: 380, buttons: { "Cancel": function() { $(this).dialog('destroy'); }, "Accept": function() { } }): } $(#link').click(function() { setDialogWindows('#change'); }); <div id="change" title="Change password" > <input type="hidden" id="User_Name" name="Name"/> <input type="textbox" id="text1" /> <input type="textbox" id="text2" /> </div>

    Read the article

  • Dynamically set the option values

    - by user281180
    I have 2 different lists: EmployeeNames and Names I read the values in Names and that of EmployeeNames. If EmployeeNames exists in Names, I must not add that value to "ToSelectBox" but to "FromSelectBox". If EmployeeNames doesn`t exist in Names, I must add that value to "ToSelectBox" but not to "FromSelectBox". How can I do that dynamically? I have 2 option values as follows: <select id="fromSelectBox" multiple="multiple" > <% foreach (var item in Model.EmployeeNames) { %> <option value="<%=Html.Encode(Item.Text)%>"><%=Html.Encode(item.Text)%></option> <%} %> </select> select id="ToSelectBox" multiple="multiple" > <% foreach (var item in Model.Names) { %> <option value="<%=Html.Encode(Item.Text)%>"><%=Html.Encode(item.Text)%></option> <%} %> </select>

    Read the article

  • How to read the values returned by the Json?

    - by user281180
    I have the following code in my view: <% using (Ajax.BeginForm("JsonCreate", new AjaxOptions { OnComplete = "createCategoryComplete" })) { % Add new category <%=Html.TextBox("CategoryId")% <%=Html.TextBox("Test")% Name: <%= Html.TextBox("Name")% <%= Html.ValidationMessage("Name")% </p> <p> <input type="submit" value="Create" /> </p> </fieldset> </div> <% } % In the controller the code is as follows: [AcceptVerbs(HttpVerbs.Post)] public JsonResult JsonCreate(string Name) { if (ModelState.IsValid) { try { //Return a json object to the javascript return Json(new { CategoryId = 123, Test= "test successful" }); } catch { #region Log errors about the exception //Log error to administrator here #endregion } } //If we got this far, something failed, return an empty json object return Json(new { /* Empty object */ }); } What should be the code in the view for the following function to read the values returned by the Json and update the textboxes for CategoryId and Test? function createCategoryComplete() {....???}

    Read the article

  • How to write submit form in another manner?

    - by user281180
    I have the follwing: <% using (Ajax.BeginForm("ChangePassword", new AjaxOptions { OnComplete = "ChangePasswordComplete" })) {% <%Html.RenderPartial("ChangePassword"); % <input type="submit" value="test" /> <%} % I want to write it in the following manner: <form> <%Html.RenderPartial("ChangePassword"); %> <input type="submit" value="test" /> </form> How can I do that? What to write in the form tag

    Read the article

  • How to submit upon a check or uncheck of checkbox in form?

    - by user281180
    I have the following in my form <td><input id="Notifications_0__IssueCreate" name="Notifications[0].IssueCreate" type="checkbox" value="true" /><input name="Notifications[0].IssueCreate" type="hidden" value="false" /></td> <td><input id="Notifications_0__AllChanges" name="Notifications[0].AllChanges" type="checkbox" value="true" /><input name="Notifications[0].AllChanges" type="hidden" value="false" /></td> In the partial view it`s wrriten as : <%int count = 0; %> <%foreach (var item in Model.List) {%> <tr> <td><%=Html.CheckBox("Notifications[" + (count) + "].IssueCreate", item.IssueCreate)%></td> <td><%=Html.CheckBox("Notifications[" + (count++) + "].AllChanges", item.AllChanges)%></td> </tr> <%} %> I want to submit to the controller upon each and every click on any of the checkbox. i.e, if user checks the checkbox, it sends the name of the checkbox and if selected or not to the controller, using ajax post. How can I do that?

    Read the article

  • Problem in reading data in table shown

    - by user281180
    I can see values shown in my table but I can`t read all of them except the first one using the following code; function ReadNames () { $('#Table tr td label').each(function () { NameID.push(this.id); }); } How can I read all the values?The table is poplulated using a click on a dialog box function addTableRow(jQtable, value, text){ jQtable.each(function() { var $table = $(this); var tds = '<tr>'; tds += '<td>' + '<label for="Name" id = ' + value + '>' + text + '</label></td>' + '<td><input type="button" value="Remove"/></td>'; tds += '</tr>'; if ($('tbody', this).length > 0) { $('tbody', this).append(tds); } else { $(this).append(tds); } }); } function read() { $("#SelectBox option").each(function() { var value = $(this).val(); var text = $(this).text(); addTableRow($('#Table'),value,text); }); }

    Read the article

< Previous Page | 1 2 3  | Next Page >