Search Results

Search found 7418 results on 297 pages for 'argument passing'.

Page 44/297 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • Passing JSON through the URI

    - by Leaf
    I'm trying to create a REST based web service with data encapsulated using JSON. My problem is when I pass the string version of JSON in the URI it turns to something like this: %7B%22coal%22:100,%22ele%22:1500.1%7D. I'm wondering if there are any functions Java for converting between the escaped and unescaped versions so I can parse the string.

    Read the article

  • Passing URL as parameter using mod_rewrite

    - by Dusan
    I would like to rewrite dynamic URL /index.php?pid=login&redirect=/previous-page.html to something like this /login.html-r-previous-page.html I tried this RewriteRule ^login.html-r-(.*)$ /index.php?pid=login&redirect=$1 [L] But no succes. I was also trying to change the regex to .+ or some other forms, but it seems useless. Maybe I am making mistake somewhere else. I am new to regular expressions and also mod_rewrite. Thank you for help

    Read the article

  • Passing Data from Usercontrol to controller

    - by nitinkhanna
    Hi, I am new to MVC, and trying something and got stuck somewhere in between. I have a user control there I have three textbox html type(ID, Lastname, firstname) and a submit buttom. I set the button like <input type="button" value="Search" onclick="location.href='<%= Url.Action("action", "controller") %>'" /> I have called this usercontrol on some view through <%= Html.Partial("ucName") %> Now on pressing that button(on user control) I need to pass the data from these textboxes to controller again to some specific action(Http Post action). By using this data I want to do some database interaction and storing the result in a dataset and pass this data set to same view again to show up in some Grid. I know the first part in conventional Asp.net can be done by raising the event through delegate but don't know how to do that in MVC.

    Read the article

  • Passing ViewData to PartialView returned from using Html.Action

    - by RWGodfrey
    I want to embed a partial view in an ASP.NET MVC page by returning it from an action method. In my base view, I would have: <%= Html.Action("MyPartialViewAction") %> My controller would have an action method like: [ChildActionOnly] public ActionResult MyPartialViewAction() { return PartialView("MyPartialView"); } I expected the returned partial view (MyPartialView) to have access to the ViewData that was set in the base page's controller action but that doesn't appear to be the case. If I insert the partial view by using the following in my base view it works: <% Html.RenderPartial("MyPartialView") %> I don't want to do that though because I want my "MyPartialViewAction" to execute logic to determine WHICH partial view to return.

    Read the article

  • Passing a paramter/object to a ruby unit/test before running it using TestRunner

    - by Nahir Khan
    I'm building a tool that automates a process then runs some tests on it's own results then goes to do some other stuff. In trying to clean up my code I have created a separate file that just has the test cases class. Now before I can run these tests, I have to pass the class a couple of parameters/objects before they can be run. Now the problem is that I can't seem to find a way to pass a parameter/object to the test class. Right now I am thinking to generate a Yaml file and read it in the test class but it feels "wrong" to use a temporary file for this. If anyone has a nicer solution that would be great! *********Edit******* Example Code of what I am doing right now: #!/usr/bin/ruby require 'test/unit/ui/console/testrunner' require 'yaml' require 'TS_SampleTestSuite' automatingSomething() importantInfo = getImportantInfo() File.open('filename.yml', 'w') do |f| f.puts importantInfo.to_yaml end Test::Unit::UI::Console::TestRunner.run(TS_SampleTestSuite) Now in the example above TS_SampleTestSuite needs importantInfo, so the first "test case" is a method that just reads in the information from the Yaml file filname.yml. I hope that clears up some confusion.

    Read the article

  • Passing javascript object to webservice via Jquery ajax

    - by kralco626
    I have a webservice that returns an object [WebMethod] public List<User> ContractorApprovals() I also have a webservice that accepcts an object [WebMethod] public bool SaveContractor(Object u) When I make my webservice calls via Jquery: function ServiceCall(method, parameters, onSucess, onFailure) { var parms = "{" + (($.isArray(parameters)) ? parameters.join(',') : parameters) + "}"; // to json $.ajax({ type: "POST", url: "services/"+method, data: parms, contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { if (typeof onSucess == 'function' || typeof onSucess == 'object') onSucess(msg.d); }, error: function(msg, err) { $("#dialog-error").dialog('open');} }); I can call the first one just fine. My onSucess function gets passed a javascript object exactly structured like my User object on the service. However, I am now having trouble getting the object back to the server. I'm accepting Object as a parameter on the server side so I can't inagine there is an issue there. So I'm thinking something is wrong with the parms on the client side but i'm not sure what... I am doing something to the effect ServiceCall("AuthorizationManagerWorkManagement.asmx/ContractorApprovals", "", function(data,args){$("#div").data('user',data[0])}, null) then ServiceCall("AuthorizationManagerWorkManagement.asmx/SaveContractor", $("#div").data('user'), //These also do not work: "{'u': ' + $("#div").data("user") + '}", NOR JSON.stringify({u: userObject}) function(data,args){(alert(data)}, null) I know the first service call works, I can get the data. The second one is causing the "onFailure" method to execute rather then "OnSuccess". Any ideas?

    Read the article

  • Passing jquery JSON from Codeigniter controller to view

    - by dede
    I've been struggling to make it work, but cannot pass the inserted data from the controler to the view in CI using JSON. The input value from the form is successfully inserted into the database, but cannot make it appear in the view. This is my view file ajax_view.php: <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-1.4.2.min.js"></script> $(document).ready(function(){ $("#submit").click(function(){ var inp = $('#inp').val(); $.post("ajax/ajax_input", { 'send' : inp }, function(data){ alert(data.input_text); }, "json"); }); }); </script> </head> <body> <form id="form1" method="post" action=""> <label for="inp">Text</label> <input type="text" name="inp" id="inp" /> <label for="submit"></label> <input type="submit" name="submit" id="submit" value="Submit" /> And this is the ajax_input method of the ajax.php controller: <?php // Initializing controller ..... // ............................. //ajax method function ajax_input(){ $var_1 = trim($this->input->post('send')); $array = array('input_text' => $var_1); echo json_encode($array); $this->db->insert('ajax',$array); } Trying to debug it with Firebug, it gives me that data.input_text is empty. What am I doing wrong? EDIT: I'm using XAMPP on Win, so is it posible that json configuration is the problem?

    Read the article

  • Passing delimited string to stored procedure to search database

    - by rs
    How can i pass a string delimited by space or comma to stored procedure and filter result? I'm trying to do something like - Parameter Value -------------------------- @keywords key1 key2 key3 Then is stored procedure i want to first find all records with first or last name like key1 filter step 1 with first or last name like key2 filter step 2 with first or last name like key 3

    Read the article

  • Passing domain name to PayPal

    - by ilhan
    I'm trying to sell something to domain owners. I need to know their domain names. Before the payment procedure I'll ask their domain names in my web site, I'll store the data in the cookies or the url, then I want to pass the data (domain name) to the PayPal so that I'll know who paid for what domain name. I know PHP and HTML in advanced level but I don't know how to pass the data to PayPal. How I'll do that? Thanks in advance!

    Read the article

  • passing variable from vbscript to batch file

    - by sushant
    i am using vbscript to call a batch file. my script looks like: dim shell set shell=createobject("wscript.shell") shell.run "a.bat" set shell=nothing my batch file is simple and looks like: D: cd D:\d winzip32.exe -min -a D:\a i want to pass a variable from a script to the batch file. lets say the destination folder. how do i do that? any help is very much appreciated.

    Read the article

  • .NET (C#) passing messages from a custom control to main application

    - by zer0c00l
    A custom windows form control named 'tweet' is in a dll. The custom control has couple of basic controls to display a tweet. I add this custom control to my main application. This custom control has a button named "retweet", when some user clicks this "retweet" button, i need to send some message to the main application. Unfortunately the this tweet control has no idea about this main application (both or in their own namespaces) How can i send messages from this custom control to the main application?

    Read the article

  • Sinatra not passing header with redirect

    - by emson
    Hi All I have a simple Sinatra proxy, which when an endpoint is called, will redirect to another endpoint on the same Sinatra proxy. When I make a request with a header, the proxy doesn't seem to pass this header through to the second endpoint when the request redirects in the first. This is my code: get '/first' do # get the header from the request username = env['HTTP_USERNAME'] # set the header for the response response['username'] = username redirect '/second' end get '/second' do # This doesn't exist when redirected from /first puts env['HTTP_USERNAME'] # Here is a list of all headers env.each_key do |key| puts "KEY: #{key} VALUE: #{env[key]}" unless key.nil? end "DONE" end Any tips would be greatly appreciated. Thanks

    Read the article

  • passing values from exe to dll c++

    - by jello
    so I have this executable which takes values from a joystick and outputs those values (i have the code). I want to pass those values to a dll, which is read in a program (i have the code for the dll). how can I pass those values from the exe to the dll?

    Read the article

  • passing an "unknown enumeration" to a method

    - by firoso
    I'm currently trying to make a class that can register strings as identifiers and accociate them with different types of Enumerations, these enumerations are being evaluated only in so much that I am ensuring that when it's used, that the parameter passed to broadcast (messageType) is an instance of the associated Enum Type. This would work something like this: Diagnostics.RegisterIdentifier("logger", typeof(TestEnum)); Diagnostics.Broadcast("logger", TestEnum.Info, null, "Hello World", null); here's the code I currently have, I need to be able to verify that messageTypesEnum is contained in messageTypesFromIdentifier. private static Dictionary<string, Type> identifierMessageTypeMapping = new Dictionary<string, Type>(); private static List<IListener> listeners = new List<IListener>(); public static void RegisterIdentifier(string identifier, Type messageTypesEnum) { if (messageTypesEnum.BaseType.FullName == "System.Enum") { identifierMessageTypeMapping.Add(identifier, messageTypesEnum); } else { throw new ArgumentException("Expected type of messageTypesEnum to derive from System.Enum", "messageTypesEnum"); } } public static void Broadcast(string identifier, object messageType, string metaIdentifier, string message, Exception exception) { if (identifierMessageTypeMapping.ContainsKey(identifier)) { Type messageTypesFromIdentifier = identifierMessageTypeMapping[identifier]; foreach (var listener in listeners) { DiagnosticsEvent writableEvent = new DiagnosticsEvent(identifier, messageType, metaIdentifier, message, exception); listener.Write(writableEvent); } } }

    Read the article

  • Help passing _POST Form Data PHP

    - by Mikey1980
    I apologize in advance, I am a PHP noob! I have form with some hidden fields. I need the values to POST to "submit_rma.php" so that they're not missing from the db--I need $qty, $estmate_id and $rma_type. The rest of the fields are just displaying data for the user and are readonly. Currently I only get value from the qty text field. Is there any easier way to pass these values? URL is out of the question due to security issues. <form method="post" action="submit_rma.php";> <table> <tr> <td> Quantity </td> <td> <input type="text" name="qty" value="<?php echo $qty ?>" size="1"/><br/> </td> </tr> <tr> <td> Part # </td> <td> <input type="text" name="" value="<?php echo $model ?>" size="8" READONLY/><br/> </td> </tr> <tr> <td> Description </td> <td> <input type="text" name="" value="<?php echo $name_EN ?>" size="50" READONLY/><br/> </td> </tr> <tr> <td> Paid Date </td> <td> <input type="text" name="" value="<?php echo $sold_date ?>" size="6" READONLY/><br/> </td> </tr> <tr> <td> Amount Each </td> <td> <input type="text" name="" value="<?php echo $dealer_price ?>" size="8" READONLY/> </td> </tr> </table> <input type="hidden" name="estmate_id" value="<?php echo $estmate_id ?>"> <input type="hidden" name="rma_type" value="Short Shipped"> <input type="submit" name="submit";"> </form>

    Read the article

  • printf not passing correct Hex Address to stack

    - by kriss
    I have a hickup in using printf . I am on ubuntu 10.04. Basically i have a C program asking for some input and then prints it back. It is OK for printing something after inputing. I tried to insert some Hex Address to Stack by following format:- printf "hello world!\x12\x23\x34" | ./input1 But i don't know what is the problem. If i give only string beyond 12 bytes it overwrites BUT If I give hex address(through printf), it doesn't overwrite on return address. Instead it stores some other thing. Could anyone help??? I can't proceed further becoz of this. Thanks in advance

    Read the article

  • Objective-C Passing a variable to another IBAction

    - by StuR
    This works fine: NSString *myVariable; - (IBAction) doFirstAction { myVariable = @"123456789"; } - (IBAction) doSecondAction { NSLog(@"%@",myVariable); } However, if I do this (substituting the @"123456789" for some code which returns the same value ie "123456789") I cannot access the value in doSecondAction. NSString *myVariable; - (IBAction) doFirstAction { myVariable = [imageNode getAttributeName:@"value"]; } - (IBAction) doSecondAction { NSLog(@"%@",myVariable); } Any clue as to why I cant access myVariable outside of doFirstAction?

    Read the article

  • vb.net session variable passing "space" from one page to another

    - by iuret
    i have 2 aspx webpages with vb.net code. On the first page, I have a text box, on first page that says "Enter Hobby", but its not a required textbox. So if the user clicks submit, it'll load up the second page. Now in the second page i have textbox "hobby" which has maxlength = 10. and in the vb.net code i have hobby.text = session("hobby"). if the user doesnt fill up hobby in first page, the session comes with 10 "spaces" since maxlength is 10. I tried hobby.text = TRIM(session("hobby"), but nothing happens. Any idea how i can lose the spaces if nothing is inputted?

    Read the article

  • Passing a WHERE clause for a Linq-to-Sql query as a parameter

    - by Mantorok
    Hi all This is probably pushing the boundaries of Linq-to-Sql a bit but given how versatile it has been so far I thought I'd ask. I have 3 queries that are selecting identical information and only differ in the where clause, now I know I can pass a delegate in but this only allows me to filter the results already returned, but I want to build up the query via parameter to ensure efficiency. Here is the query: from row in DataContext.PublishedEvents join link in DataContext.PublishedEvent_EventDateTimes on row.guid equals link.container join time in DataContext.EventDateTimes on link.item equals time.guid where row.ApprovalStatus == "Approved" && row.EventType == "Event" && time.StartDate <= DateTime.Now.Date.AddDays(1) && (!time.EndDate.HasValue || time.EndDate.Value >= DateTime.Now.Date.AddDays(1)) orderby time.StartDate select new EventDetails { Title = row.EventName, Description = TrimDescription(row.Description) }; The code I want to apply via a parameter would be: time.StartDate <= DateTime.Now.Date.AddDays(1) && (!time.EndDate.HasValue || time.EndDate.Value >= DateTime.Now.Date.AddDays(1)) Is this possible? I don't think it is but thought I'd check out first. Thanks

    Read the article

  • Passing extended parameter into Sql 2008 connection string

    - by Pita.O
    Hi, I have a need to support extensive auditing capabilities for a system backing into Sql Server 2008. Since I plan to use LINQ (with no Stored Procs), the database would be a clean, zero contact data repository. However, I need to pratically record a snapshot of every change that happens in the db. So, I thought I should use triggers. But then, I need a user id for the particular user (not the connection string user id) to flow through into the database. In oracle, I should have been able to set up a PROXY USER and the trigger would be able to pick that up. Last I checked, there was no proxy user concept in Sql Server. Does anyone know if there's any extender property I can use to flow through my authenticated user name? ps: I don't mind the impact on connection pooling (if any). Thanks. P

    Read the article

  • Passing list of values to django view via jQuery ajax call

    - by finspin
    I'm trying to pass a list of numeric values (ids) from one web page to another with jQuery ajax call. I can't figure out how to pass and read all the values in the list. I can successfully post and read 1 value but not multiple values. Here is what I have so far: jQuery: var postUrl = "http://localhost:8000/ingredients/"; $('li').click(function(){ values = [1, 2]; $.ajax({ url: postUrl, type: 'POST', data: {'terid': values}, traditional: true, dataType: 'html', success: function(result){ $('#ingredients').append(result); } }); }); /ingredients/ view: def ingredients(request): if request.is_ajax(): ourid = request.POST.get('terid', False) ingredients = Ingredience.objects.filter(food__id__in=ourid) t = get_template('ingredients.html') html = t.render(Context({'ingredients': ingredients,})) return HttpResponse(html) else: html = '<p>This is not ajax</p>' return HttpResponse(html) With Firebug I can see that POST contains both ids but probably in the wrong format (terid=1&terid=2). So my ingredients view picks up only terid=2. What am I doing wrong? EDIT: To clarify, I need the ourid variable pass values [1, 2] to the filter in the ingredients view.

    Read the article

  • Passing dynamic string in hyperlink as parameter in jsp

    - by user3660263
    I am trying to pass a dynamic string builder variable in jsp I am generating a string through code. String Builder variable has some value but i am not able to pass it in at run time.It doesn't get the value. CODE FOR VARIABLE <% StringBuilder sb=new StringBuilder(""); if(request.getAttribute("Brand")!=null) { String Brand[]=(String[])request.getAttribute("Brand"); for(String brand:Brand) { sb.append("Brand="); sb.append(brand); sb.append("&&"); } } if(request.getAttribute("Flavour")!=null) { String Flavour[]=(String[])request.getAttribute("Flavour"); for(String flavour:Flavour) { sb.append(flavour); sb.append("&&"); } sb.trimToSize(); pageContext.setAttribute("sb", sb); } out.print("this is string"+sb); %> CODE FOR HYPERLINK <a href="Filter_Products?${sb}page=${currentPage + 1}" style="color: white;text-decoration: none;">Next</a></td>

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >