Search Results

Search found 10634 results on 426 pages for 'pass'.

Page 26/426 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • ASP.NET MVC Pass mutiple params from getJson to controller

    - by andyJ
    Hi, I am making a call to a controller action in javascript using the getJson method. I need to pass two parameters to my action method on the controller, but I am struggling to do so. I do not fully understand the routing tables and not sure if this is what I need to use to get this working. Please see example below of what I am trying to do. var action = "<%=Url.Content('~/Postcode/GetAddressResults/')%>" + $get("Premise").value + "/" + $get("SearchPostcode").value $.getJSON(action, null, function(data) { $("#AddressDropDown").fillSelect(data); }); This is my route which I don't understand how to make use of... routes.MapRoute( "postcode", "Postcode/GetAddressResults/{premise}/{postcode}", new { controller = "Motor", action = "GetAddressResults", premise = "", postcode = "" });

    Read the article

  • R: Pass by reference

    - by Pierre
    Can you pass by reference with "R" ? for example, in the following code: setClass("MyClass", representation( name="character" )) instance1 <-new("MyClass",name="Hello1") instance2 <-new("MyClass",name="Hello2") array = c(instance1,instance2) instance1 array instance1@name="World!" instance1 array the output is > instance1 An object of class “MyClass” Slot "name": [1] "World!" > array [[1]] An object of class “MyClass” Slot "name": [1] "Hello1" [[2]] An object of class “MyClass” Slot "name": [1] "Hello2" but I wish it was > instance1 An object of class “MyClass” Slot "name": [1] "World!" > array [[1]] An object of class “MyClass” Slot "name": [1] "World!" [[2]] An object of class “MyClass” Slot "name": [1] "Hello2" is it possible ? Thanks Pierre

    Read the article

  • Pass data to Master Page with ASP.NET MVC

    - by Brian David Berman
    I have a hybrid ASP.NET WebForms/MVC project. In my Master Page, I have a "menu" User Control and a "footer" User Control. Anyways. I need to pass some data (2 strings) to my "menu" User Control on my Master Page (to select the current tab in my menu navigation, etc.) My views are strongly-typed to my data model. How can I push data from my controller to my menu or at least allow my master page to access some data pre-defined in my controller? Note: I understand this violates pure ASP.NET MVC, but like I said, it is a hybrid project. The main purpose of my introduction to ASP.NET MVC into my project was to have more control over my UI for certain situations only.

    Read the article

  • CComPtr pass by reference

    - by Mahesh
    I have a situation where I need to pass a CComPtr<IXmlReader> to a function by reference. Does the called parameter takes the ownership from the callee parameter (or) the reference count is increased? void foo( CComPtr<IXmlReader> & pReader ) { // There is no reassignment of the CComPtr. // Just call the IXmlReader methods. } CComPtr<IXmlReader> pReader; foo( pReader ); // Is pReader still valid after the function return ? Thanks.

    Read the article

  • How do I pass credentials to a machine so I can use Microsoft.Win32.RegistryKey.OpenRemoteBaseKey()

    - by JCCyC
    This .NET API works OK if I'm trying to open the Registry in a machine that's in the same domain as I am (and my logged-on user has admin rights on the target machine). It gets tricky if it's an out-of-domain machine with a different, local administrative user (of whom I do have the password). I tried to use WNetUseConnection() (which has served me well in the past in situations where what I wanted was to read a remote disk file) prior to calling OpenRemoteBaseKey(), but no dice -- I get an access denied exception. Clearly, I must pass credentials some other way, but how?

    Read the article

  • Pass by reference in Boost::Python

    - by Fabzter
    Hi everybody. Consider something like: struct Parameter { int a; Parameter(){a = 0} void setA(int newA){a = newA;} }; struct MyClass { void changeParameter(Parameter &p){ p.setA(-1);} }; Well, let's fast forward, and imagine I already wrapped those classes, exposing everything to python, and imagine also I instantiate an object of Parameter in the C++ code, which I pass to the python script, and that python script uses a MyClass object to modify the instance of Parameter I created at the beginning in the C++ code. After that code executes, in C++ Parameter instance is unchanged!!! This means it was passed by value (or something alike :S), not by reference. But I thought I declared it to be passed by reference... I can't seem to find Boost::Python documentation about passing by reference (although there seems to be enough doc about returning by reference...). Can anyone give some hint or pointer please?

    Read the article

  • trying to pass file name from aspx page to console.exe

    - by ryder1211212
    i want to pass the value of a lable or textbox in an aspx page to a console.exe application such that the if the value is sample.doc it changes to that. i am calling from the aspx page with string f = TextBox1.Text; System.Diagnostics.Process.Start("C:/DocUpload/ConsoleApplication1.exe", f); i have tried converting to string then using the string vatiable inplace of sample.doc but no luck object FileName = System.IO.Path.Combine(ExecutableFileInfo.DirectoryName, "sample.doc"); any help or ideas will be welcomed. thank u

    Read the article

  • How to pass data between pages without sessions in ASP.net MVC

    - by Ashwani K
    Hello All: I have one application in which I want to pass data between Pages (Views) without sessions. Actually I want to apply some settings to all the pages using query string. For example if my link is like "http://example.com?data=test1", then I want to append this query string to all the link there after and if there is no query string then normal flow. I was thinking if there is any way that if we get the query string in any link for the web application then some application level user specific property can be set which can be used for subsequent pages. Thanks, Ashwani

    Read the article

  • RadGrid cannot pass sortExpression to ObjectDataSourceControl

    - by Jeff
    I have a Telerik RadGrid that bound to a datasource object. They are configured to support custom paging, sorting. For paging, only the data of a page is retrieved from the database. Before sorting, it works fine. The select method of the datasource is like public List<xxx> Select(string sortExpression, int maximumRows, int startRowIndex) {} Before sorting the sortExpression is empty, which is expected. But after use click sort, in the OnSortCommand event handler of Radgrid, the SortExpression is correct, indicating RadGrid has caputre user's sorting correctly. protected void OnSort(object source, GridSortCommandEventArgs e) { Console.WriteLine(e.SortExpression); // correct } But what is strange is that the RadGrid does not pass parameter to DataSource correctly this time. sortExpression is still empty, maximumRows became int.Max, and startRowIndex is 0. The the sorting in still render correctly, but grid ask datasource to get all data and do the sorting locally. Is this bug of RadGrid or my configuration is wrong?

    Read the article

  • C++ pass enum as parameter

    - by Spencer
    If I have a simple class like this one for a card: class Card { public: enum Suit { CLUBS, DIAMONDS, HEARTS, SPADES }; Card(Suit suit); }; and I then want to create an instance of a card in another file how do I pass the enum? #include "Card.h" using namespace std; int main () { Suit suit = Card.CLUBS; Card card(suit); return 0; } error: 'Suit' was not declared in this scope I know this works: #include "Card.h" using namespace std; int main () { Card card(Card.CLUBS); return 0; } but how do I create a variable of type Suit in another file? Thanks, Spencer

    Read the article

  • One pass multiple whitespace replace to single whitespace and eliminate leading and trailing whitesp

    - by Phoenix
    void RemoveSpace(char *String) { int i=0,y=0; int leading=0; for(i=0,y=0;String[i]!='\0';i++,y++) { String[y]=String[i]; // let us copy the current character. if(isspace(String[i])) // Is the current character a space? { if(isspace(String[i+1])||String[i+1]=='\0'||leading!=1) // leading space y--; } else leading=1; } String[y]='\0'; } Does this do the trick of removing leading and trailing whitespaces and replacing multiple whitespaces with single ones ?? i tested it for null string, all whitespaces, leading whitespaces and trailing whitespaces. Do you think this is an efficient one pass solution ??

    Read the article

  • PHP Exec command - How to pass input to a series of questions

    - by user556597
    I have a program on my linux server that asks the same series of questions each time it executes and then provides several lines of output. My goal is to automate the input and output with a php script. I know how to capture the output in an array by writing: $out = array(); exec("my/path/program",$out); But how do I handle the input? Assume the program asks 3 questions and valid answers are: left 120 n What is the easiest way using php to pass that input to the program? Can I do it somehow on the exec line? I’m not a php noob but simply have never needed to do this before. Alas, my googling is going in circles.

    Read the article

  • How to Pass parameter to SQlDataSource from gridview?

    - by user144842
    Gridview has many columns and a Delete button as well. Delete button is a control as TemplateField <asp:TemplateField> <ItemTemplate> <asp:LinkButton ID="btnDelete" CommandName="Delete" Text='<%# Eval("disabled").ToString()=="False" ? "Disabled" : "Enabled" %>' OnClientClick="return confirm('Are you sure you want to take this action?');" runat="server"></asp:LinkButton> </ItemTemplate> </asp:TemplateField> Now associated SQLDataSource's Delete command's stored procedure is expecting two parameters. One is going from DataKeyNames (RowID), other one i wanna pass is the Text of btnDelete (True or False). How can i achieve it?

    Read the article

  • Why PartCover report shows 0% when mstest runs successfully and all tests pass

    - by SvetlanaM
    Hello, I'm trying to get code coverage with mstest tests. I'm using PartCover 2.2.0.36424. The problem is with real assemblies, I get 0% code coverage (Note: All tests pass). On demo test for demo source that I created, it worked fine (the report makes sense). I noticed that in log file: for demo files, after line "Assembly AAAAAA loaded (MyTestesAssemblyName)", there is line "Class NNNNNN loaded (MyTestesAssemblyName.MyClassname)"; and for the real files ther is no second line (for class) after the line for assembly. Have any ideas what is different in our assemblies? (Note: they are not signed) 10x.

    Read the article

  • How to pass a very long string/file into RESTWebservice JAX-RS Jersey

    - by Sashikiran Challa
    Hello All, I am trying to write a webservice that takes in an XML string, does parsing of it using DOM and extract particular things I want. My XML string happens to be very long so I do not want to pass it as a @QueryParam or @PathParam. Say If I write that XML string into a file, How do I go about writing a RESTful service that takes in this file, extracts whatever I want and return the results. I am actually trying to extract some number of strings, so my output should probably be an ArrayList having all these strings. Could somebody please shed some light on how I should go about doing this. Thanks in advance

    Read the article

  • Pass Data to Data Template Selector

    - by Michael Sync
    How do you guys pass the data (parameter) to DataTemplate Selector? The only one that I can think of is to use an attached property in DataTemplate Selector? Example: public class DisableWeekendsSelection : DataTemplateSelector { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2211:NonConstantFieldsShouldNotBeVisible", Justification = "DependencyProperty")] public static readonly DependencyProperty Parameter = DependencyProperty.RegisterAttached("Parameter", typeof(ObservableCollection<Date>), typeof(DisableWeekendsSelection), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault)); public static ObservableCollection<Date> GetParameter(DependencyObject dp) { return dp.GetValue(Parameter) as ObservableCollection<Date>; } public static void SetParameter(DependencyObject dp, ObservableCollection<Date> value) { dp.SetValue(Parameter, value); } public override DataTemplate SelectTemplate(object item, DependencyObject container) { The problem with this approach is that I'm not able to get the value of Parameter in SelectTemplate method. Any suggestion would be appreciated. Thanks in advance.

    Read the article

  • How can arguments to variadic functions be passed by reference in PHP?

    - by outis
    Assuming it's possible, how would one pass arguments by reference to a variadic function without generating a warning in PHP? We can no longer use the '&' operator in a function call, otherwise I'd accept that (even though it would be error prone, should a coder forget it). What inspired this is are old MySQLi wrapper classes that I unearthed (these days, I'd just use PDO). The only difference between the wrappers and the MySQLi classes is the wrappers throw exceptions rather than returning FALSE. class DBException extends RuntimeException {} ... class MySQLi_throwing extends mysqli { ... function prepare($query) { $stmt = parent::prepare($query); if (!$stmt) { throw new DBException($this->error, $this->errno); } return new MySQLi_stmt_throwing($this, $query, $stmt); } } // I don't remember why I switched from extension to composition, but // it shouldn't matter for this question. class MySQLi_stmt_throwing /* extends MySQLi_stmt */ { protected $_link, $_query, $_delegate; public function __construct($link, $query, $prepared) { //parent::__construct($link, $query); $this->_link = $link; $this->_query = $query; $this->_delegate = $prepared; } function bind_param($name, &$var) { return $this->_delegate->bind_param($name, $var); } function __call($name, $args) { //$rslt = call_user_func_array(array($this, 'parent::' . $name), $args); $rslt = call_user_func_array(array($this->_delegate, $name), $args); if (False === $rslt) { throw new DBException($this->_link->error, $this->errno); } return $rslt; } } The difficulty lies in calling methods such as bind_result on the wrapper. Constant-arity functions (e.g. bind_param) can be explicitly defined, allowing for pass-by-reference. bind_result, however, needs all arguments to be pass-by-reference. If you call bind_result on an instance of MySQLi_stmt_throwing as-is, the arguments are passed by value and the binding won't take. try { $id = Null; $stmt = $db->prepare('SELECT id FROM tbl WHERE ...'); $stmt->execute() $stmt->bind_result($id); // $id is still null at this point ... } catch (DBException $exc) { ... } Since the above classes are no longer in use, this question is merely a matter of curiosity. Alternate approaches to the wrapper classes are not relevant. Defining a method with a bunch of arguments taking Null default values is not correct (what if you define 20 arguments, but the function is called with 21?). Answers don't even need to be written in terms of MySQL_stmt_throwing; it exists simply to provide a concrete example.

    Read the article

  • How to pass -f specdoc option through rake task

    - by dorelal
    I am using rails 2.3.5 .rake spec works fine. This is from spec --help. spec --help -f, --format FORMAT[:WHERE] Specifies what format to use for output. Specify WHERE to tell the formatter where to write the output. All built-in formats expect WHERE to be a file name, and will write to $stdout if it's not specified. The --format option may be specified several times if you want several outputs Builtin formats: silent|l : No output progress|p : Text-based progress bar profile|o : Text-based progress bar with profiling of 10 slowest examples specdoc|s : Code example doc strings nested|n : Code example doc strings with nested groups indented html|h : A nice HTML report failing_examples|e : Write all failing examples - input for --example failing_example_groups|g : Write all failing example groups - input for --example How do I pass -f specdoc through rake task.

    Read the article

  • Pass array of data to jQuery function

    - by ILMV
    Here's the story... I have a jQuery function that does something, this function is referenced very regularly. One of the input parameters is an array, this array data is hard coded and thus I want to pass the data like this: (this is how I would do it using PHP) myFunction(Array("1"=>"a","2"=>"b","3"=>"c")); Instead of $arr=Array("1"=>"a","2"=>"b","3"=>"c"); myFunction($arr); So how do I achieve this with my jQuery function, I want this to be a one liner if possible.

    Read the article

  • Pass NSMutableArray between two UIViewController's

    - by aahrens
    I have two view controllers name RootViewController and SecondViewController. In the FirstViewController I have this NSMutableArray @interface RootViewController : UITableViewController { NSMutableArray *allClasses;}@property (nonatomic,retain) NSMutableArray *allClasses; In the RootViewController I populate the UITableView with all the objects within allClasses In my SecondViewController I have @interface SecondViewController : UIViewController <UITextFieldDelegate,UIPickerViewDelegate> { NSMutableArray *arrayStrings;} I have a method that adds new NSStrings to the arrayStrings. My goal is to be able to pass the arrayStrings to the RootViewController by trying something similar to allClasses = arrayStrings. That way when the RootViewController is loaded it can populate with new information. How would I got about accomplishing that task?

    Read the article

  • Pass selected option to remote_function with Ruby on Rails

    - by mathee
    I have a list of options generated by the following Haml code. %select#tags{:onchange => remote_function(:url => {:action => :display_tag_cart}, :with => 'Form.Element.serialize(this)'), :prompt => 'Choose a Tag'} %option{:value=>""} Choose a Tag -Tag::TAGS.each do |t| %option{:value=>t.id} =h t.name Form.Element.serialize(this) does not work. How do I pass the value of the selection to display_tag_cart?

    Read the article

  • How to pass parameters in jquery

    - by Priyanka
    Hello. I am supposed to submit 2values called str and name to another page.But only 1value is getting returned in the next page.When i include name and on next page if i say print_r($_POST),then even the first value is not getting printed. I have written a fuction as follows,which works because there is only one parameter. function sendValue(str) { $.post( "newsletter/subscribe.php", //Ajax file { sendValue: str }, function(data){ $('#display').html(data.returnValue); }, "json" ); } But if i pass 2values in that function and in $.post,i do sendValue:str,name then i am not getting even 1value. Please help me.

    Read the article

  • Pass elements of a list as arguments to a function in python

    - by Wilduck
    I'm building a simple interpreter in python and I'm having trouble handling differing numbers of arguments to my functions. My current method is to get a list of the commands/arguments as follows. args = str(raw_input('>> ')).split() com = args.pop(0) Then to execute com, I check to see if it is in my dictionary of command- code mappings and if it is I call the function I have stored there. For a command with no arguments, this would look like: commands[com]() However, if a command had multiple arguments, I would want this: commands[com](args[0],args[1]) Is there some trick where I could pass some (or all) of the elements of my arg list to the function that I'm trying to call? Or is there a better way of implementing this without having to use python's cmd class?

    Read the article

  • How to pass 2 variables to a php document with jquery

    - by Nikos
    Hello I have two text inputs which get their values from a datepicker. What I want to do is when user selects the two dates script pass these two values to a php document in which I make some checks and I return some html. Here is what I'm trying to do: (#to and $from are 2 input texts) $(document).ready(dateinput_change); function dateinput_change(){ $('#to').change(check_availability); $('#from').change(check_availability); } function check_availability(){ var to=$('#to').attr('value'); var from=$('#from').attr('value'); $.get("get_availability.php?to="+ to +"&from="+ from, show_availability); } function show_availability(available){ $('#availability').html(available); }

    Read the article

  • How to pass the parameter in SQL query from PowerShell

    - by Zshava
    I have this code in PowerShell, that executes SQL query for UPDATE table: $Connection=new-object data.sqlclient.sqlconnection "server=server;database=mydb;trusted_connection=true;" $Connection.open() For( $i = 0; $i -le $ActID.Length; $i ++ ){ $cmd = New-Object System.Data.SqlClient.SqlCommand $cmd.Connection = $Connection $cmd.CommandText = " update Table set Note = @PATH " $cmd.Parameters.Add("@PATH", $ActID[$i].Values) | Out-Null $cmd.ExecuteNonQuery() } I try to update table with variable defined in this string: $cmd.Parameters.Add("@PATH", $ActID[$i].Values) | Out-Null But when i try to execute script, error log says that there is no value passed in $ActID[$i] Is there other methods to pass parameters (variables) in powershell queries?

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >