Search Results

Search found 1863 results on 75 pages for 'matt fordham'.

Page 52/75 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • How do I get Asp.net MVC BeginForm to add closing tag correctly?

    - by Matt
    I seem to be missing something obvious here, but cannot see what it is. My problem is that the closing form tag for BeginForm is not being added to my markup. I am looping through a collection and creating a form for each item, but the forms arent closing properly. Any suggestions please? Thanks <% foreach (var item in Model) { %> <% using (Html.BeginForm("EditUser","Users")) { %> <tr> <td> <input id="contactID" type="hidden" value="<%= item.ContactID %>" /> <%=item.Email %> </td> <td> <%=item.Market.MarketName%> </td> <td> <%=item.ContactType.ContactTypeName%> </td> <td> <input type="submit" value="Edit" /> </td> </tr> <%} %> <% } %>

    Read the article

  • Using jQuery to call a web service

    - by Matt
    I have created a web service which takes a username and password as parameters and returns a list of children in JSON (the user is a Social Worker). The web service is hosted locally with IIS7. I am attempting to access the web service using javascript/jquery because it will eventually need to run as a mobile app. I'm not really experienced with web services, or javascript for that matter, but the following two links seemed to point me in the right direction: http://williamsportwebdeveloper.com/cgi/wp/?p=494 http://encosia.com/using-jquery-to-consume-aspnet-json-web-services/ This is my html page: <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="TestWebService.aspx.cs" Inherits="Sponsor_A_Child.TestWebService" %> <asp:Content ID="Content1" ContentPlaceHolderID="stylesPlaceHolder" runat="server"> <script type="text/javascript" src="Scripts/jquery-1.7.1.js"> $(document).ready(function () { }); function LoginClientClick() { $("#query_results").empty(); $("#query_results").append('<table id="ResultsTable" class="ChildrenTable"><tr><th>Child_ID</th><th>Child_Name</th><th>Child_Surname</th></tr>'); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "http://localhost/PhoneWebServices/GetChildren.asmx/GetMyChildren", data: '{ "email" : "' + $("#EmailBox").val() + '", "password": "' + $("#PasswordBox").val() + '" }', dataType: "json", success: function (msg) { var c = eval(msg.d); alert("" + c); for (var i in c) { $("#ResultsTable tr:last").after("<tr><td>" + c[i][0] + "</td><td>" + c[i][1] + "</td><td>" + c[i][2] + "</td></tr>"); } } }); } </script> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" runat="server"> <div id="LoginDiv"> Email: <input id="EmailBox" type="text" /><br /> Password: <input id="PasswordBox" type="password" /><br /> <input id="LoginButton" type="button" value="Submit" onclick="LoginClientClick()" /> </div> <div id="query_results"> </div> </asp:Content> And this is my web service code: [WebMethod (Description="Returns the list of children for whom the social worker is responsible.")] public String GetMyChildren(String email,String password) { DataSet MyChildren=new DataSet(); int ID=SocialWorkerLogin(email, password); if (ID > 0) { MyChildren = FillChildrenTable(ID); } MyChildren.DataSetName = "My Children"; //To prevent 'DataTable name not set' error string[][] JaggedArray = new string[MyChildren.Tables[0].Rows.Count][]; int i = 0; foreach (DataRow rs in MyChildren.Tables[0].Rows) { JaggedArray[i] = new string[] { rs["Child_ID"].ToString(), rs["Child_Name"].ToString(), rs["Child_Surname"].ToString() }; i = i + 1; } // Return JSON data JavaScriptSerializer js = new JavaScriptSerializer(); string strJSON = js.Serialize(JaggedArray); return strJSON; } I followed the examples in the provided links, but when I press submit, only the table headers appear but not the list of children. When I test the web service on it's own though, it does return a JSON string so that part seems to be working. Any help is greatly appreciated :)

    Read the article

  • How can I mark a file as descended from 2 other files in Mercurial?

    - by Matt Joiner
    I had 2 Python similar scripts, that I've since merged into one (and now takes some parameters to differ the behaviour appropriately). Both of the previous files are in the tip of my Mercurial repository. How can I indicate that the new file, is a combination of the 2 older files that I intend to remove? Also note, that 1 file has been chosen in favor of the other, and some code moved across, so if it's not possible to create a version controlled file with a new name, then assimilating one file's history into the other will suffice.

    Read the article

  • SQL Server 2005 Create Table with Column Default value range

    - by Matt
    Trying to finish up some homework and ran into a issue for creating tables. How do you declare a column default for a range of numbers. Its reads: "Column Building (default to 1 but can be 1-10)" I can't seem to find ...or know where to look for this information. CREATE TABLE tblDepartment ( Department_ID int NOT NULL IDENTITY, Department_Name varchar(255) NOT NULL, Division_Name varchar(255) NOT NULL, City varchar(255) default 'spokane' NOT NULL, Building int default 1 NOT NULL, Phone varchar(255) ) I tried Building int default 1 Between 1 AND 10 NOT NULL, that didn't work out I tried Building int default 1-10, the table was created but I don't think its correct.

    Read the article

  • Performance of VIEW vs. SQL statement

    - by Matt W.
    I have a query that goes something like the following: select <field list> from <table list> where <join conditions> and <condition list> and PrimaryKey in (select PrimaryKey from <table list> where <join list> and <condition list>) and PrimaryKey not in (select PrimaryKey from <table list> where <join list> and <condition list>) The sub-select queries both have multiple sub-select queries of their own that I'm not showing so as not to clutter the statement. One of the developers on my team thinks a view would be better. I disagree in that the SQL statement uses variables passed in by the program (based on the user's login Id). Are there any hard and fast rules on when a view should be used vs. using a SQL statement? What kind of performance gain issues are there in running SQL statements on their own against regular tables vs. against views. (Note that all the joins / where conditions are against indexed columns, so that shouldn't be an issue.) EDIT for clarification... Here's the query I'm working with: select obj_id from object where obj_id in( (select distinct(sec_id) from security where sec_type_id = 494 and ( (sec_usergroup_id = 3278 and sec_usergroup_type_id = 230) or (sec_usergroup_id in (select ug_gi_id from user_group where ug_ui_id = 3278) and sec_usergroup_type_id = 231) ) and sec_obj_id in ( select obj_id from object where obj_ot_id in (select of_ot_id from obj_form left outer join obj_type on ot_id = of_ot_id where ot_app_id = 87 and of_id in (select sec_obj_id from security where sec_type_id = 493 and ( (sec_usergroup_id = 3278 and sec_usergroup_type_id = 230) or (sec_usergroup_id in (select ug_gi_id from user_group where ug_ui_id = 3278) and sec_usergroup_type_id = 231) ) ) and of_usage_type_id = 131 ) ) ) ) or (obj_ot_id in (select of_ot_id from obj_form left outer join obj_type on ot_id = of_ot_id where ot_app_id = 87 and of_id in (select sec_obj_id from security where sec_type_id = 493 and ( (sec_usergroup_id = 3278 and sec_usergroup_type_id = 230) or (sec_usergroup_id in (select ug_gi_id from user_group where ug_ui_id = 3278) and sec_usergroup_type_id = 231) ) ) and of_usage_type_id = 131 ) and obj_id not in (select sec_obj_id from security where sec_type_id = 494) )

    Read the article

  • Printing a string and variable in MIPS

    - by Matt
    Here's the C representation of what I'm trying to do in MIPS assembly: printf ("x=%d\n", x); I know that I can do a syscall to easily print x= and I can also do a syscall to print the int x (which is stored in a register). However, that prints them like this (let's say x is 5): x= 5 How can I make them print on the same line?

    Read the article

  • Codeigniter - accessing variables from an array passed into a page.

    - by Matt
    Hello, I have a controller with an index function as follows: function index() { $this->load->model('products_model'); $data['product'] = $this->products_model->get(3); // 3 = product id $data['product_no'] = 3; $data['main_content'] = 'product_view'; //print_r($data['products']); $this->load->view('includes/template', $data); } This is the get function in the products_model file function get($id) { $results = $this->db->get_where('products', array('id' => $id))->result(); //get the first item $result = $results[0]; return $result; } The products table contains fields such as name, price etc. Please can you tell me how to output variables from $data['product'] after it is passed into the view? I have tried so many things but nothing is working, even though the print_r (commented out) shows the data - it is not being passed into the view. I thought it may have been because the view calls a template file which references the main_content variable: Template file contents: <?php $this->load->view('includes/header'); ?> <?php $this->load->view($main_content); ?> <?php $this->load->view('includes/footer'); ?> but i tried creating a flat view file and still couldn't access the variables. Many thanks,

    Read the article

  • Configuration Element Collection Section

    - by Matt
    I would like to set up a custom app configuration element collection section like this <logSectionGroup> <logSection name="Testttt"> <properties name ="Pride"> <pathName="TestingLog.txt"/> <deleteRetention="100"/> <deleteZeroRetention="5"/> <wildcard="*.txt"/> </properties> <properties name ="Adhoc"> <pathName="blah.txt"/> <deleteRetention="70"/> <deleteZeroRetention="3"/> <wildcard="*.*"/> </properties> </logSection> </logSectionGroup> Is this possible? Properties would be the configuration element, and log section would be the configuration element collection. The problem is, I've only seen where you can have multiple instances of a single element instead of multiple elements. <Section name="Section1"> <Section name="Section1"> <SubSection name="SubSection1"> <Item name="Item1" /> <Item name="Item2" /> </SubSection> <SubSection name="SubSection2"> <Item name="Item1" /> <Item name="Item2" /> </SubSection> </Section> When you use GetElementKey() you have it return element "name" in the above example but how would you return 4 different elements like "pathName" "deleteRetention" etc. Here is my Definition for PropElement Public Class PropElement Inherits ConfigurationElement <ConfigurationProperty("pathName", IsRequired:=True)> _ Public Property PathName() As String Get Return CStr(Me("pathName")) End Get Set(ByVal value As String) Me("pathName") = value End Set End Property <ConfigurationProperty("deleteRetention", DefaultValue:="0", IsRequired:=False)> _ Public Property DeleteRetention() As Integer Get Return CStr(Me("deleteRetention")) End Get Set(ByVal value As Integer) Me("deleteRetention") = value End Set End Property <ConfigurationProperty("deleteZeroRetention", DefaultValue:="0", IsRequired:=False)> _ Public Property DeleteZeroRetention() As Integer Get Return CStr(Me("deleteZeroRetention")) End Get Set(ByVal value As Integer) Me("deleteZeroRetention") = value End Set End Property <ConfigurationProperty("wildcard", DefaultValue:="*.*", IsRequired:=False)> _ Public Property Wildcard() As String Get Return CStr(Me("wildcard")) End Get Set(ByVal value As String) Me("wildcard") = value End Set End Property End Class

    Read the article

  • PHP Connect to 4D Database

    - by Matt Reid
    Trying to connect to 4D Database. PHPINFO says PDO is installed etc etc... Testing on localhost MAMP system. However when I run my code I get: Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /Applications/MAMP/htdocs/4d/index.php:12 Stack trace: #0 /Applications/MAMP/htdocs/4d/index.php(12): PDO->__construct('4D:host=127.0.0...', 'test', 'test') #1 {main} thrown in /Applications/MAMP/htdocs/4d/index.php on line 12 My code is: $dsn = '4D:host=127.0.0.1;charset=UTF-8'; $user = 'test'; $pass = 'test'; // Connection to the 4D SQL server $db = new PDO($dsn, $user, $pass); try { echo "OK"; } catch (PDOException $e) { die("Error 4D : " . $e->getMessage()); } Can't put my finger on the error, i'm using the settings under the PHP tab... Thank you.

    Read the article

  • Jakarta Regexp 1.5 Backreferences?

    - by Matt Smith
    Why does this match: String str = "099.9 102.2" + (char) 0x0D; RE re = new RE("^([0-9]{3}.[0-9]) ([0-9]{3}.[0-9])\r$"); System.out.println(re.match(str)); But this does not: String str = "099.9 102.2" + (char) 0x0D; RE re = new RE("^([0-9]{3}.[0-9]) \1\r$"); System.out.println(re.match(str)); The back references don't seem to be working... What am I missing?

    Read the article

  • How to implement a Client-side Ajax Login on Asp.Net MVC (A link to the solution for Asp.Net Webform

    - by Matt
    Hi, I'm trying to implement a client-side ajax login on Asp.Net MVC. I used to have this set up just fine on WebForms, but now that I've moved to MVC it's giving me some troubles. If you'd like a tutorial on Client-side Ajax Login for Asp.Net Webforms, it can be found here -- Easy, A++ Now... for some reason it's not working for Asp.Net MVC. I used the exact same tutorial as for the Webforms, except when it executes the ssa.login() (equivalently: Sys.Services.AuthenticationService.login()) it's not doing anything. I have alerts in both the onLoginComplete() function and the onError() function. As well I have an alert before the ssa.login gets called and right after... function loginHandler() { var username = $("#login_UserName").val(); var password = $("#login_Password").val(); var isPersistent = $("#login_RememberMe").attr("checked"); var customInfo = null; var redirectUrl = null; // Log them in. alert("try login"); ssa.login(username, password, isPersistent, customInfo, redirectUrl, onLoginComplete, onError); alert("made it here"); } The first alert fires but the second one doesn't which means the function is failing. Here's the function I pulled from Asp.Net Ajax to show you: function(c, b, a, h, f, d, e, g) { this._invoke(this._get_path(), "Login", false, { userName: c, password: b, createPersistentCookie: a }, Function.createDelegate(this, this._onLoginComplete), Function.createDelegate(this, this._onLoginFailed), [c, b, a, h, f, d, e, g]); } Anyone have any idea of why it's failing?

    Read the article

  • Automaticly Change VisualState in Silverlight

    - by Matt
    If you create a simple button and then choose Edit Template - Edit a Copy, Blend will automatically generate a style area, along with all the button states (MouseEnter, MouseLeave, Pressed, etc). No where in the generated code does it say that on a "MouseOver" event, change the state to "MouseOver", but it still manages to work! How does a standard button do it? Is there some sort of AutoEventWireUp going on?

    Read the article

  • Equivalent to GetTickCount() on Linux

    - by Matt Joiner
    I'm looking for an equivalent to GetTickCount() on Linux. Presently I am using Python's time.time() which presumably calls through to gettimeofday(). My concern is that the time returned (the unix epoch), may change erratically if the clock is messed with, such as by NTP. A simple process or system wall time, that only increases positively at a constant rate would suffice. Does any such time function in C or Python exist?

    Read the article

  • Dump Microsoft SQL Server database to an SQL script

    - by Matt Sheppard
    Is there any way to export a Microsoft SQL Server database to an sql script? I'm looking for something which behaves similarly to mysqldump, taking a database name, and producing a single script which will recreate all the tables, stored procedures, reinsert all the data etc. I've seen http://vyaskn.tripod.com/code.htm#inserts, but I ideally want something to recreate everything (not just the data) which works in a single step to produce the final script.

    Read the article

  • Node.js Creating and Deleting a File Recursively

    - by Matt
    I thought it would be a cool experiment to have a for loop and create a file hello.txt and then delete it with unlink. I figured that if fs.unlink is the delete file procedure in Node, then fs.link must be the create file. However, my code will only delete, and it will not create, not even once. Even if I separate the fs.link code into a separate file, it still will not create my file hello.txt. Below is my code: var fs = require('fs'), for(var i=1;i<=10;i++){ fs.unlink('./hello.txt', function (err) { if (err){ throw err; } else { console.log('successfully deleted file'); } fs.link('./hello.txt', function (err) { if (err){ throw err; } else { console.log('successfully created file'); } }); }); } http://nodejs.org/api/fs.html#fs_fs_link_srcpath_dstpath_callback Thank you!

    Read the article

  • Partial template specialization for more than one typename

    - by Matt Joiner
    In the following code, I want to consider functions (Ops) that have void return to instead be considered to return true. The type Retval, and the return value of Op are always matching. I'm not able to discriminate using the type traits shown here, and attempts to create a partial template specialization based on Retval have failed due the presence of the other template variables, Op and Args. How do I specialize only some variables in a template specialization without getting errors? Is there any other way to alter behaviour based on the return type of Op? template <typename Retval, typename Op, typename... Args> Retval single_op_wrapper( Retval const failval, char const *const opname, Op const op, Cpfs &cpfs, Args... args) { try { CallContext callctx(cpfs, opname); Retval retval; if (std::is_same<bool, Retval>::value) { (callctx.*op)(args...); retval = true; } else { retval = (callctx.*op)(args...); } assert(retval != failval); callctx.commit(cpfs); return retval; } catch (CpfsError const &exc) { cpfs_errno_set(exc.fserrno); LOGF(Info, "Failed with %s", cpfs_errno_str(exc.fserrno)); } return failval; }

    Read the article

  • I can't change HTTP request header Content-Type value using jQuery

    - by Matt
    Hi I tried to override HTTP request header content by using jQuery's AJAX function. It looks like this $.ajax({ type : "POST", url : url, data : data, contentType: "application/x-www-form-urlencoded;charset=big5", beforeSend: function(xhr) { xhr.setRequestHeader("Accept-Charset","big5"); xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=big5"); }, success: function(rs) { target.html(rs); } }); Content-Type header is default to "application/x-www-form-urlencoded; charset=UTF-8", but it obviously I can't override its value no matter I use 'contentType' or 'beforeSend' approaches. Could anyone adivse me a hint that how do I or can I change the HTTP request's content-type value? thanks a lot. btw, is there any good documentation that I can study JavaScript's XMLHttpRequest's encoding handling?

    Read the article

  • using javascript setTimeout to see if div has loaded

    - by Matt
    I'm loading remote data using dynamic script tags and JSON. the remote page that I'm displaying on my website has a div in it that I use to load content into. The problem is the javascript functions do not see the div as the page loads because it is remote data. if I set a timeout of about 300 it usually works and my javascipt can see the div. But sometimes it takes longer and it breaks the javascript. I'm tring this: function load_content() { if(document.getElementById('remote_div')==null) { setTimeout('load_content()', 300); } else { document.getElementById('remote_div').innerHTML = 'Content goes here' } } but it just doesn't seem to work... what is wrong with it?

    Read the article

  • Optimizing python link matching regular expression

    - by Matt
    I have a regular expression, links = re.compile('<a(.+?)href=(?:"|\')?((?:https?://|/)[^\'"]+)(?:"|\')?(.*?)>(.+?)</a>',re.I).findall(data) to find links in some html, it is taking a long time on certain html, any optimization advice? One that it chokes on is http://freeyourmindonline.net/Blog/

    Read the article

  • how do you load files in windows phone 7? using XNA

    - by matt
    do you seriously have to make your own content pipeline project for every single type of file you want to load? Microsoft just seem to be pretending that the iphone doesn't exist (even though they are now paying devs to port between them). I'm trying to port my game from the iphone to winmo7, and I already have a nice asset pipeline set up for exporting textures in the exact format we want (16 bit fmts ect) I just want to be able to open a file and read it, just like I would on any other platform. I have tried System.IO.File.OpenText("atextfile.txt"), but it says that function is "RESTRICTED!!!!" I have tried just adding the txt file to the content project, setting its properties to "content" and "copy always" and then trying to open it doing this.Content.Load("atextfile.txt"); with and without the extension, says it can't find the file. EDIT: FYI, i'm using XNA, not Silverlight

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >