Search Results

Search found 9087 results on 364 pages for 'strong parameters'.

Page 5/364 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Passing parameters in MVC

    - by Avinash
    Thare is two forms in a page first one for searching and another for deleting.... <table><tr><td> <% using(Html.BeginForm("ViewList","ControllerName", [values],FormMethod.Post,new{id="viewListForm"})) { %> Name: <%=Html.TextBox("Name", "[value]", new { maxlength = "250" })%> Location: <%=Html.TextBox("Location", "[Value]", new { maxlength = "250" })%> <input type="submit" id="Search" name="Search" value="Search" /> <% } %> </td></tr> <tr><td> <% using(Html.BeginForm("DeleteList","ControllerName", new { name=?,location=? },[values],FormMethod.Post, new{id="deleteListForm"})) { %> [here the code for all items displayed in a table.] <input type="submit" id="Delete" name="Delete" value="Delete" /> When delete buttom pressed i need to pass two parameters ie name and location. The values of name and location are in the above viewListForm. How i take this value from the viewListForm at run time ? <% } %> </td></tr><table>

    Read the article

  • PHP Redirection with Post Parameters

    - by arik-so
    Hello, I have a webpage. This webpage redirects the user to another webpage, more or less the following way: <form method="post" action="anotherpage.php" id="myform"> <?php foreach($_GET as $key => $value){ echo "<input type='hidden' name='{$key}' value='{$value}' />"; } ?> </form> <script> document.getElementById('myform').submit(); </script> Well, you see, what I do is transferring the GET params into POST params. Do not tell me it is bad, I know that myself, and it is not exactly what I really do, what is important is that I collect data from an array and try submitting it to another page via POST. But if the user has JavaScript turned off, it won't work. What I need to know: Is there a way to transfer POST parameters by means of PHP so the redirection can be done the PHP way (header('Location: anotherpage.php');), too? It is very important for me to pass the params via POST. I cannot use the $_SESSION variable because the webpage is on another domain, thus, the $_SESSION variables differ. Anyway, I simply need a way to transfer POST variables with PHP ^^ Thanks in advance!

    Read the article

  • C++ Constructor With Parameters Won't Initialize, Errors C2059 and C2228

    - by Some Girl
    I'm a C# programmer trying to muddle through C++ to create a Windows Forms Application. I have a Windows Form that makes use of a user-created class. Basically I'm trying to use a constructor that takes parameters, but my form won't let me initialize the object with parameter. Here's the code, hopefully somebody can explain the problem to me because I'm completely baffled... Here's my header file: BankAcct.h public ref class BankAcct { private: int money; public: BankAcct(); BankAcct(int); void Deposit(int); void GetBalance(int&); }; And my definition file: BankAcct.cpp #include "StdAfx.h" #include "BankAcct.h" BankAcct::BankAcct() { money = 0; } BankAcct::BankAcct(int startAmt) { money = startAmt; } void BankAcct::Deposit(int depAmt) { money += depAmt; } void BankAcct::GetBalance(int& balance) { balance = money; } And finally my main form. Won't copy the whole thing, of course, but I'm trying to declare the new bank account object, and start it with a balance of say $50. private: BankAcct myAccount(50); //does not work! WHY?? //private: //BankAcct myAccount; //works then in the form constructor my code is this: public: frmBank(void) { InitializeComponent(); int bal; myAccount.GetBalance(bal); lblBankBalance->Text += Convert::ToString(bal); } I've included the BankAcct.h file at the top of my frmBank.h, what else am I doing wrong here? It works great if I use the default constructor (the one that starts the bank balance at zero). I get the following error messages: error C2059: syntax error: 'constant' and error C2228: left of '.GetBalance' must have class/struct/union Thank you for any and all help on this one!!

    Read the article

  • Using Sitecore RenderingContext Parameters as MVC controller action arguments

    - by Kyle Burns
    I have been working with the Technical Preview of Sitecore 6.6 on a project and have been for the most part happy with the way that Sitecore (which truly is an MVC implementation unto itself) has been expanded to support ASP.NET MVC. That said, getting up to speed with the combined platform has not been entirely without stumbles and today I want to share one area where Sitecore could have really made things shine from the "it just works" perspective. A couple days ago I was asked by a colleague about the usage of the "Parameters" field that is defined on Sitecore's Controller Rendering data template. Based on the standard way that Sitecore handles a field named Parameters, I was able to deduce that the field expected key/value pairs separated by the "&" character, but beyond that I wasn't sure and didn't see anything from a documentation perspective to guide me, so it was time to dig and find out where the data in the field was made available. My first thought was that it would be really nice if Sitecore handled the parameters in this field consistently with the way that ASP.NET MVC handles the various parameter collections on the HttpRequest object and automatically maps them to parameters of the action method executing. Being the hopeful sort, I configured a name/value pair on one of my renderings, added a parameter with matching name to the controller action and fired up the bugger to see... that the parameter was not populated. Having established that the field's value was not going to be presented to me the way that I had hoped it would, the next assumption that I would work on was that Sitecore would handle this field similar to how they handle other similar data and would plug it into some ambient object that I could reference from within the controller method. After a considerable amount of guessing, testing, and cracking code open with Redgate's Reflector (a must-have companion to Sitecore documentation), I found that the most direct way to access the parameter was through the ambient RenderingContext object using code similar to: string myArgument = string.Empty; var rc = Sitecore.Mvc.Presentation.RenderingContext.CurrentOrNull; if (rc != null) {     var parms = rc.Rendering.Parameters;     myArgument = parms["myArgument"]; } At this point, we know how this field is used out of the box from Sitecore and can provide information from Sitecore's Content Editor that will be available when the controller action is executing, but it feels a little dirty. In order to properly test the action method I would have to do a lot of setup work and possible use an isolation framework such as Pex and Moles to get at a value that my action method is dependent upon. Notice I said that my method is dependent upon the value but in order to meet that dependency I've accepted another dependency upon Sitecore's RenderingContext.  I'm a big believer in, when possible, ensuring that any piece of code explicitly advertises dependencies using the method signature, so I found myself still wanting this to work the same as if the parameters were in the request route, querystring, or form by being able to add a myArgument parameter to the action method and have this parameter populated by the framework. Lucky for us, the ASP.NET MVC framework is extremely flexible and provides some easy to grok and use extensibility points. ASP.NET MVC is able to provide information from the request as input parameters to controller actions because it uses objects which implement an interface called IValueProvider and have been registered to service the application. The most basic statement of responsibility for an IValueProvider implementation is "I know about some data which is indexed by key. If you hand me the key for a piece of data that I know about I give you that data". When preparing to invoke a controller action, the framework queries registered IValueProvider implementations with the name of each method argument to see if the ValueProvider can supply a value for the parameter. (the rest of this post will assume you're working along and make a lot more sense if you do) Let's pull Sitecore out of the equation for a second to simplify things and create an extremely simple IValueProvider implementation. For this example, I first create a new ASP.NET MVC3 project in Visual Studio, selecting "Internet Application" and otherwise taking defaults (I'm assuming that anyone reading this far in the post either already knows how to do this or will need to take a quick run through one of the many available basic MVC tutorials such as the MVC Music Store). Once the new project is created, go to the Index action of HomeController.  This action sets a Message property on the ViewBag to "Welcome to ASP.NET MVC!" and invokes the View, which has been coded to display the Message. For our example, we will remove the hard coded message from this controller (although we'll leave it just as hard coded somewhere else - this is sample code). For the first step in our exercise, add a string parameter to the Index action method called welcomeMessage and use the value of this argument to set the ViewBag.Message property. The updated Index action should look like: public ActionResult Index(string welcomeMessage) {     ViewBag.Message = welcomeMessage;     return View(); } This represents the entirety of the change that you will make to either the controller or view.  If you run the application now, the home page will display and no message will be presented to the user because no value was supplied to the Action method. Let's now write a ValueProvider to ensure this parameter gets populated. We'll start by creating a new class called StaticValueProvider. When the class is created, we'll update the using statements to ensure that they include the following: using System.Collections.Specialized; using System.Globalization; using System.Web.Mvc; With the appropriate using statements in place, we'll update the StaticValueProvider class to implement the IValueProvider interface. The System.Web.Mvc library already contains a pretty flexible dictionary-like implementation called NameValueCollectionValueProvider, so we'll just wrap that and let it do most of the real work for us. The completed class looks like: public class StaticValueProvider : IValueProvider {     private NameValueCollectionValueProvider _wrappedProvider;     public StaticValueProvider(ControllerContext controllerContext)     {         var parameters = new NameValueCollection();         parameters.Add("welcomeMessage", "Hello from the value provider!");         _wrappedProvider = new NameValueCollectionValueProvider(parameters, CultureInfo.InvariantCulture);     }     public bool ContainsPrefix(string prefix)     {         return _wrappedProvider.ContainsPrefix(prefix);     }     public ValueProviderResult GetValue(string key)     {         return _wrappedProvider.GetValue(key);     } } Notice that the only entry in the collection matches the name of the argument to our HomeController's Index action.  This is the important "secret sauce" that will make things work. We've got our new value provider now, but that's not quite enough to be finished. Mvc obtains IValueProvider instances using factories that are registered when the application starts up. These factories extend the abstract ValueProviderFactory class by initializing and returning the appropriate implementation of IValueProvider from the GetValueProvider method. While I wouldn't do so in production code, for the sake of this example, I'm going to add the following class definition within the StaticValueProvider.cs source file: public class StaticValueProviderFactory : ValueProviderFactory {     public override IValueProvider GetValueProvider(ControllerContext controllerContext)     {         return new StaticValueProvider(controllerContext);     } } Now that we have a factory, we can register it by adding the following line to the end of the Application_Start method in Global.asax.cs: ValueProviderFactories.Factories.Add(new StaticValueProviderFactory()); If you've done everything right to this point, you should be able to run the application and be presented with the home page reading "Hello from the value provider!". Now that you have the basics of the IValueProvider down, you have everything you need to enhance your Sitecore MVC implementation by adding an IValueProvider that exposes values from the ambient RenderingContext's Parameters property. I'll provide the code for the IValueProvider implementation (which should look VERY familiar) and you can use the work we've already done as a reference to create and register the factory: public class RenderingContextValueProvider : IValueProvider {     private NameValueCollectionValueProvider _wrappedProvider = null;     public RenderingContextValueProvider(ControllerContext controllerContext)     {         var collection = new NameValueCollection();         var rc = RenderingContext.CurrentOrNull;         if (rc != null && rc.Rendering != null)         {             foreach(var parameter in rc.Rendering.Parameters)             {                 collection.Add(parameter.Key, parameter.Value);             }         }         _wrappedProvider = new NameValueCollectionValueProvider(collection, CultureInfo.InvariantCulture);         }     public bool ContainsPrefix(string prefix)     {         return _wrappedProvider.ContainsPrefix(prefix);     }     public ValueProviderResult GetValue(string key)     {         return _wrappedProvider.GetValue(key);     } } In this post I've discussed the MVC IValueProvider used to map data to controller action method arguments and how this can be integrated into your Sitecore 6.6 MVC solution.

    Read the article

  • 7 Tips For Strong On Page SEO

    On page SEO is the first thing a webmaster should consider when planning the marketing of his website. Follow these simple yet effective methods to give your SEO campaign a kick start.

    Read the article

  • Achieving a Strong SEO Rating

    SEO or Search Engine Optimization is a must if you are serious in having your website placed with the search engine, and with great results. There are important guidelines to be followed. It is really not that hard to understand even for beginners. For beginners the term optimization may sound somewhat difficult, when actually it is very doable.

    Read the article

  • Linux: Strong and getting stronger

    <b>CNet:</b> "At the Linux Foundation's annual collaboration summit in San Francisco on Wednesday, Executive Director Jim Zemlin kicked off the event with some interesting perspectives on the state of the Linux marketplace today."

    Read the article

  • A strong component keeps everything together

    - by Justin Paul-Oracle
    Most of the times you implement a WebCenter Content based system, you require some sort of customization. Sometimes these customizations need a Java class or two, or libraries (for example, the JavaMail API), or Database Objects (like new tables, views, indexes, etc). I have seen that libraries and Database Objects are usually put in place using manual steps. This means that the library jar files are copied to one of the common classes directory (set in the Content CLASSPATH variable) and/or the database scripts are executed manually. I have also seen people place the custom Java classes in the common classes directory. While this may seem like an easy solution, think about a scenario where you need to disable or uninstall the component or if you have to upgrade or migrate the system. You have to keep these manual steps documented and execute them every time you encounter the above scenarios. It is very common that some of these manual steps are missed when you have multiple teams and people working on the system. Here are a few points to ponder upon: Place all your custom Java classes within your component. Create a new directory, say ${COMPONENT_DIR}/classes, and place your code there. You can choose to bundle all your classes into a jar or you can place the entire class directory structure. Add a path entry to the Build Settings so that it is bundled with the component when you build it. You also need to update the Custom Class Path and the Custom Class Path Load Order under the Advanced Build Settings. This will ensure that the system CLASSPATH is updated to add this new directory. Create a new component for any new library that you want to add. Add the appropriate path entries to the Build Settings so that it is bundled with the component when you build it. You also need to update the Custom Class Path, Custom Class Path Load Order and/or the Custom Library Path under the Advanced Build Settings. Enter a comma separated list of features that this component will provide. When you create other components that will use the features exposed by this component, make sure that you specify a dependency to this library component by specifying the comma separated list of features in the Advanced Build Settings. The component wizard allows you to create custom install/uninstall Java code. The wizard will create a install filter class when you check the “Has Install” checkbox on the “Install/Uninstall Settings” tab. Consider using this filter class to create database objects when you install the component and drop the objects when you uninstall the component. If you do a lot of custom component development, consider creating a install/uninstall Java class, which can execute queries defined within the component. To sum up, whenever you write a new custom component, make sure that you bundle everything within the component.

    Read the article

  • Hack Fest Going Strong!

    - by Yolande Poirier
    Today was the first day of  the Hack Fest at Devoxx, the Java developer conference in Belgium.  The Hack Fest started with the Raspberry Pi & Leap Motion hands-on lab. Vinicius Senger introduced the Java Embedded, Arduino and Raspberry Pi. Java Champion Geert Bevin presented the Leap Motion, a controller sensing your hands and fingers to play games by controlling the mouse as an example. "Programmers are cooler than musicians because they can create entire universe using all senses" explained Geert In teams, participants started building applications using Raspberry Pi, sensors and relays. One team tested the performance of Tomcat, Java EE and Java Embedded Suite on the Raspberry Pi. Another used built an text animation using a LCD screen. Teams are using the Leap Motion to close and open programs on the desktop and other teams are using it as a game control. 

    Read the article

  • Indian Broadband Services to Post Strong Growth

    Broadband is one of the most dynamic segments of the Indian telecommunication market. The expansion of Broadband services could be attributed to competitive pricing plans offered by the private telec... [Author: Shushmul Maheshwari - Computers and Internet - June 04, 2010]

    Read the article

  • Outsource SEO - A Strong Business Case

    Outsourcing became quite popular in the 1990's as companies raced to reduce costs by moving non-essential functions out of the corporate cost structure. One of the main methods for doing this was to outsource. The basic business case to move any function to a subcontract was quite simple. Subcontractors that focus only on one thing have probably developed a deeper technical understanding of the process and are more effective. Economies of scale allow the outsourcer to provide the same (or higher quality) service at a lower price.

    Read the article

  • SEO is Not a Strong Point For Retailers

    It is to be expected that top retailers know what good search engine optimisation is all about - especially because they are all about conversions and sales. But new research has shown that the opposite appears to be true. According to search engine marketing industry analyst Conductor, the top 500 internet retailers spent $1.

    Read the article

  • How to Maintain Strong Search Engine Rankings

    Search engines rankings are very important for anyone who has a website and wants to attract free online traffic. By achieving and maintaining high rankings your site will receive a steady flow of search engine traffic. Read more to see 3 SEO tips that will help you maintain a high website rank with minimal time and effort.

    Read the article

  • Outsource SEO - A Strong Business Case

    Outsourcing became quite popular in the 1990's as companies raced to reduce costs by moving non-essential functions out of the corporate cost structure. One of the main methods for doing this was to outsource. The basic business case to move any function to a subcontract was quite simple. Subcontractors that focus only on one thing have probably developed a deeper technical understanding of the process and are more effective. Economies of scale allow the outsourcer to provide the same (or higher quality) service at a lower price.

    Read the article

  • get GET parameters in JSF's managed bean

    - by mykola
    Hello! Can someone tell me how to catch parameters passed from URI in JSF's managed bean? I have a navigation menu all nodes of which link to some navigation case. And i have two similar items there: Acquiring products and Issuing products. They have the same page but one different parameter: productType. I try to set it just by adding it to URL in "to-view-id" element like this: <navigation-case> <from-outcome>acquiring|products</from-outcome> <to-view-id>/pages/products/list_products.jspx?productType=acquiring</to-view-id> </navigation-case> <navigation-case> <from-outcome>issuing|products</from-outcome> <to-view-id>/pages/products/list_products.jspx?productType=issuing</to-view-id> </navigation-case> But i can't get this "productType" from my managed bean. I tried to get it through FacesContext like this: FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("productType") And like this: HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest(); request.getParameter("productType"); And i tried to include it as a parameter of managed bean in faces-config.xml and then getting it through ordinary setter: <managed-bean> <managed-bean-name>MbProducts</managed-bean-name> <managed-bean-class>my.package.product.MbProducts</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>productType</property-name> <value>#{param.productType}</value> </managed-property> </managed-bean> ... public class MbProducts { ... public void setProductType(String productType) { this.productType = productType; } ... } But neither of these ways have helped me. All of them returned null. How can i get this productType? Or how can i pass it some other way?

    Read the article

  • Python constructor does weird things with optional parameters

    - by christangrant
    Can you help me understand of the behaviour and implications of the python __init__ constructor. It seems like when there is an optional parameter and you try and set an existing object to a new object the optional value of the existing object is preserved and copied. Ok that was confusing... so look at an example I concocted below. In the code below I am trying to make a tree structure with nodes and possibly many children . In the first class NodeBad, the constructor has two parameters, the value and any possible children. The second class NodeGood only takes the value of the node as a parameter. Both have an addchild method to add a child to a node. When creating a tree with the NodeGood class, it works as expected. However, when doing the same thing with the NodeBad class, it seems as though a child can only be added once! The code below will result in the following output: Good Tree 1 2 3 [< 3 >] Bad Tree 1 2 2 [< 2 >, < 3 >] Que Pasa? Here is the Example: #!/usr/bin/python class NodeBad: def __init__(self, value, c=[]): self.value = value self.children = c def addchild(self, node): self.children.append(node) def __str__(self): return '< %s >' % self.value def __repr__(self): return '< %s >' % self.value class NodeGood: def __init__(self, value): self.value = value self.children = [] def addchild(self, node): self.children.append(node) def __str__(self): return '< %s >' % self.value def __repr__(self): return '< %s >' % self.value if __name__ == '__main__': print 'Good Tree' ng = NodeGood(1) # Root Node rootgood = ng ng.addchild(NodeGood(2)) # 1nd Child ng = ng.children[0] ng.addchild(NodeGood(3)) # 2nd Child print rootgood.value print rootgood.children[0].value print rootgood.children[0].children[0].value print rootgood.children[0].children print 'Bad Tree' nb = NodeBad(1) # Root Node rootbad = nb nb.addchild(NodeBad(2)) # 1st Child nb = nb.children[0] nb.addchild(NodeBad(3)) # 2nd Child print rootbad.value print rootbad.children[0].value print rootbad.children[0].children[0].value print rootbad.children[0].children

    Read the article

  • URL Multiple Query Parameters Encoded with HTML Entities

    - by BRADINO
    I came across a situation where a URL with multiple query parameters was encoded using htmlentities() and PHP was not recognizing the query parameters using $_GET. A common case for encoding urls using htmlentities() is to use them inside XML documents. So a url with multiple query parameters, encoded using htmlentities() would look like this: http://www.bradino.com/?color=white&amp;size=medium&amp;quantity=3 and when that url is accessed the second and third query parameters are not recognized because instead of separating the subsequent variables with an & that character gets converted into &amp;. I could not find a good way to resolve this, so basically I just encoded the query string back to normal using html_entity_decode() and then slammed the parameters back into the $_GET array using parse_str(). $query = html_entity_decode($_SERVER['QUERY_STRING']); parse_str($query,$_GET); There must be a better way! Anyone come across this before?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >