parameters

Restrict value of a parameter in a constructor AT DESIGN TIME

I'd like to restrict the value of a number parameter in a constructor to within a certain range. I know the conventional way is to do something like the following: public class Foo { public int MaxAmount { get; } public int Amount { get; set; } public Foo(int amount) { if (amount > MaxAmount) { Amount = MaxAmou...

Parameters for webservice call from ASP.NET MVC/jQuery best practice

I need to call a webservice which takes as parameters things like the database name, schema name, login credentials etc. I'd ideally like to call the webservice directly from jQuery, but I feel that these parameters belong in the web config so perhaps I should be calling the webservice indirectly through an ajaxed MVC controller method....

Xslt collection as parameter.

Hello, Could you help me to answer how to put collection of data as parameter in the xslt file, is it possible ? Thanks. ...

Zend Framework Change parameter in route on the same spot?

I'm not sure how to fix this, or wat is the best way to approach this. Also couldn't find enough information to get me on the right way (could be that my searching sucks..) Anyway, this is my problem: I defined a route in my bootstrap file: protected function _initRoutes() { $router = $this->frontController->getRouter(); ...

Rails 2 Trailing Route Parameter

I'm building an article/blog website where any article may show up within a series of URL paths. /section/article /section/page/article /section/page/page2/article This works, but what if I wanted to have the page number for that article (/page/123) be bound to those URLs /section/article/page/123/ /section/page/article/page/123 /sec...

.NET Parameterize Queries Injection

Are Parametrize Queries in .NET safe from SQL Inject? That is, does .NET automatically escape dangerous characters when you use Parameters? ...

input type=text $POST value is null

i'm trying to send the value of the search textbox via jquery on keydown to the php page so that it can display the results containing the search keyword. however, the php page is not reading $_POST of the input textbox [not button]. html: .keydown(function() { //create post data var postData = { "bsearch" : $(this).va...

How to avoid ODBC parameterization for the question mark character ? within literals and comments?

I'm running into an issue where I have question mark characters '?' within my SQL scripts inside comments is causing problems. When I run these statements through an ODBC connection using the Visual FoxPro SQLEXEC function these characters are being seen as parameters and VFP prompts for values. What are my options for dealing with ques...

Add parameters to Apache HttpPost

Hello, I'm trying to send a file to a Servlet. Along with this file, I also have to send some parameters (i.e. name/id, date and a few others). I'm using HttpClient on client-side and ServerFileUpload on server-side. This is the client-side code: ... String url = "http://localhost:8080/RicezioneServlet/RicezioneServlet"; HttpClient htt...

Struts 2 Action: parameter access

Hi, I defined an action like this: <action name="login" class="tognetti.site.actions.AuthenticationAction"> <param name="defaultURI">/secure/listaAnnunci.action</param> <result>/login.jsp</result> </action> I can I access the param from inside the action? Thanks ...

Parameters passing style in Perl

I see people using two styles for passing named parameters in Perl: use strict; use warnings; use Data::Dumper; sub foo { print Dumper @_; } sub bar { print Dumper @_; } foo( A => 'a', B => 'b' ); bar( { A => 'a', B => 'b' } ); What are the advantages in using foo() style instead of bar() style? ...

What is the correct URI for sending parameters via POST in WCF REST Services?

Hi all, Let's say that I have specified the following WCF REST Service at the address "http://localhost/MyRESTService/MyRESTService.svc" [ServiceContract] public interface IMyRESTService { [OperationContract] [WebInvoke( Method = "POST", UriTemplate = "/receive")] string Receive(string text); Now I can call my REST service in Fid...

browsers don't resend form data in ajax call if they are redirected??!

Hi guys, I've been tinkering with URL Rewriting on my site and fixing the canonicalization of my URLs (so I don't have duplicate data on search engines, etc.) and it was recommended everywhere to either always remove/force the trailing slash (I chose to remove it) and also to redirect /index to . So I put the following two rules in my ...

including parameters in OPENQUERY...

How can I use a parameter inside sql openquery, such as: SELECT * FROM OPENQUERY([NameOfLinkedSERVER], 'SELECT * FROM TABLENAME where field1=@someParameter') T1 INNER JOIN MYSQLSERVER.DATABASE.DBO.TABLENAME T2 ON T1.PK = T2.PK ...

Configure EJB3 with web.xml like parameters

Hi, I'd like to pass some parameters to a stateless session bean. I'd like to do something like I do when I configure a Servlet initial parameters in the web.xml file. Thanks ...

Dynamic/Anonymous type, returning anonymous types!

this is not a question as i think its discussion, i know you cant return an anonymous type across methods, when i first used anonymous types i thought it would be really nice to be able to return it across methods and when .net 4 came out and with the edition of the dynamic types i thought there might be a hope in returning an anonymous ...

Passing dynamic data to javascript.

It is good idea not to hardcode anything that may change in javascript. For example I want to have url generated by php. I may write echo " <script ...> var anUrl = $urlFromPHP; </script>"; and then: <script ...> // some code $.ajax({ url: anUrl ... }); </script>"; Is there any better way to do it? Does anybody know if...

ExecuteNonQuery with parameters.

I have to process a file that contains a large number of sql statements. The issue is that the sql statement contain parameters. E.g. the file looks like this declare @var1 as nvarchar; set @var1 = 'value'; insert into table (field1, field2, field3) values ('value1', 'value2', @var1); repeates with the next set of three lines. I ...

Flex 3 - Issues passing parameters through an event

Hello Community! I'm stuck with an issue and I cannot understand why it behaves like that... In a for loop, I'm passing the for index as an event parameter. However, the eventHandler is getting the wrong index, but the right target... Here's some code. .as class method: public function set dataProvider(a:Array):void { var x:int =...

Nicer way of paramter checking?

Hi, We use the .NET 2.0 framework with C# 3.0 (I think it's the last version of C# which can run on the 2.0 version of the framework, correct me if I am wrong). Is there something built into C# which can make this type of parameter validation more convenient? public ConnectionSettings(string url, string username, string password, ...