Search Results

Search found 15137 results on 606 pages for 'global state'.

Page 46/606 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • Adding global blank option to DroDownList in MVC

    - by Diegos Grace
    Is there a way of using a templated helper in mvc so that each and every select list in my project has a custom default 'Choose an option' with null value etc. The posts I have seen seem a little complex, is it possible to have a DropDownList.ascx file in shared view folder with something like this: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<SelectListItem>>" %> <%= Html.DropDownList(selectlist name, selectlist value, "Choose an option")%> And then having a UIHint("DropDownList") for each dropdownlist in the ViewModel? Some guidance on syntax of parameters would be much appreciated, where name and value of the viewmodel dropdownlist plus the 'Choose an option' string are passed. Or is this all wishful thinking?

    Read the article

  • How can I utilize or mimic Application OnStart in an HttpModule?

    - by Sailing Judo
    We are trying to remove the global.asax from our many web applications in favor of HttpModules that are in a common code base. This works really well for many application events such as BeginRequest and PostAuthentication, but there is no Application Start event exposed in the HttpModule. I can think of a couple of smelly ways to overcome this deficit. For example, I can probably do this: protected virtual void BeginRequest(object sender, EventArgs e) { Log.Debug("Entered BeginRequest..."); var app = HttpContext.Current.Application; var hasBeenSet app["HasBeenExecuted"] == null ? false : true; if(!hasBeenSet) { app.Lock(); // ... do app level code app.Add("HasBeenSet", true); app.Unlock(); } // do regular begin request stuff ... } But this just doesn't smell well to me. What is the best way to invoke some application begin logic without having a global.asax?

    Read the article

  • Visual Studio: Where are global settings stored?

    - by Philipp
    Hi, sometimes after logging out and in again, my settings in Tools/Options/Projects and Solutions/VC++ Directories are lost. To investigate the problem I tried to find the file where Visual Studio (2008 Team) stores those settings on disk. (Or is it in the registry?) Can anybody point me to where it is? Thanks a lot!

    Read the article

  • Where are global settings stored?

    - by Philipp
    Hi, sometimes after logging out and in again, my settings in Tools/Options/Projects and Solutions/VC++ Directories are lost. To investigate the problem I tried to find the file where Visual Studio (2008 Team) stores those settings on disk. (Or is it in the registry?) Can anybody point me to where it is? Thanks a lot!

    Read the article

  • How do I use global resources in WPF?

    - by Banford
    I have a WPF application which I would like to use some static resources in. I have created a Resource Library XAML file which contains a resource. I have also added a string into the Resources of the project through the Properties panel. I assumed I could just use these resources with the binding expression: {StaticResource ResourceName} But visual studio is telling me the resources are not found. Do I have to include some form of reference in my XAML? The examples I have seen only include resources locally such as: <Window.Resources>, <Page.Resources> etc I don't want to include the resources locally because I want them to be available to multiple parts of the application.

    Read the article

  • Call to a member function query() on a non-object

    - by Randy Gonzalez
    Ok, this is so weird!!! I am running PHP Version 5.1.6 when I try and run the code below it gives a fatal error of an object that has not been instantiated. As soon as I un-comment this line of code //$cb_db = new cb_db(USER, PASSWORD, NAME, HOST); everything works. Even though I have declared the $cb_db object as global within in the method. Any help would be greatly appreciated. require_once ( ROOT_CB_CLASSES . 'db.php'); $cb_db = new cb_db(USER, PASSWORD, NAME, HOST); class cb_user { protected function find_by_sql( $sql ) { global $cb_db; //$cb_db = new cb_db(USER, PASSWORD, NAME, HOST); $result_set = $cb_db->query( $sql ); $object_array = array(); while( $row = $cb_db->fetch_array( $result_set ) ) { $object_array[] = self::instantiate( $row ); } return $object_array; } }

    Read the article

  • C++, LHS state after exception is thrown

    - by aaa
    hi. I am learning C++ exceptions and I would like some clarification of the scenario: T function() throws(std::exception); ... T t = value; try { t = function(); } catch (...) {} if the exception is thrown, what is the state of variable t? unchanged or undefined?

    Read the article

  • Problem in Application_Error in Global.asax

    - by mmtemporary
    my problem is User.Identity.Name or Request.Url.AbsoluteUri in exception handling is empty when exception email to me. this is Application_Code: void Application_Error(object sender, EventArgs e) { Server.Transfer("~/errors/default.aspx"); } and this is default.aspx code: protected void Page_Load(object sender, EventArgs e) { if (Server.GetLastError() == null) return; Exception ex = Server.GetLastError().GetBaseException(); if (ex == null) return; string message = string.Format("User: ", User.Identity.Name); message += Environment.NewLine; message += string.Format("AbsoluteUri: ", Request.Url.AbsoluteUri); message += Environment.NewLine; message += string.Format("Form: ", Request.Form.ToString()); message += Environment.NewLine; message += string.Format("QueryString: ", Request.QueryString.ToString()); message += Environment.NewLine; HttpBrowserCapabilities browser = Request.Browser; string s = "Browser Capabilities:\n" + "Type = " + browser.Type + "\n" + "Name = " + browser.Browser + "\n" + "Version = " + browser.Version + "\n" + "Platform = " + browser.Platform + "\n" + "Is Crawler = " + browser.Crawler + "\n" + "Supports Cookies = " + browser.Cookies + "\n" + "Supports JavaScript = " + browser.EcmaScriptVersion.ToString() + "\n" + "\n"; message += s; message += Environment.NewLine; message += ex.ToString(); Exception lastException = (Exception)Application["LastException"]; if (lastException == null || lastException.Message != ex.Message) { Application.Lock(); Application["LastException"] = ex; Application.UnLock(); SiteHelper.SendEmail(SiteHelper.AdministratorEMail, "Error!!!", message, false); } Server.ClearError(); } but i receive email like this (this is header without full exception content): User: AbsoluteUri: Form: QueryString: Browser Capabilities: Type = IE8 Name = IE Version = 8.0 Platform = WinXP Is Crawler = False Supports Cookies = True Supports JavaScript = 1.2 why username and request url is emty? this problem is exist when i replace transfer with redirect or i don't use both. tanx

    Read the article

  • Getting State of Modifier Keys Compact Framework

    - by CDM
    How can I get the state of a modifier key using VB.NET on the Compact Framework, in this case Windows Mobile 6.1. I want to be able to determine if the following keys are pressed or locked: Shift CTRL ALT and for the Psion Teklogix machines Orange Blue Although I may be able to work this out, if I can determine the others. I want to create my own on-screen indicator panel and want to poll the keys, not using events.

    Read the article

  • Modifying a global variable from <a href>

    - by a_m0d
    I have created some code to popup a confirm dialog if a user tries to leave a page without saving their changes. However, I don't want the confirmation dialog to popup if the user has clicked the "Save" button. I have some code at the top of my file which looks like this: var confirmClose = false; window.onbeforeunload = function(evt) { if (confirmClose == true) { message = "There are unsaved changes on this page. Are you sure you wish to leave?"; if (typeof evt == 'undefined') { evt = window.event; } if (evt) { evt.returnValue = message; } return message; } } Further down on the page I have a link which looks like this: <a href="javascript:confirmClose=false;$('#stockForm').submit()" title="Save" class="button positive" id="stockFormSubmit">Save</a> However, this doesn't seem to work - it doesn't seem to change the value of confirmClose, and changing it to window.confirmClose didn't help either. What am I doing wrong here?

    Read the article

  • asp.net mvc radio button state

    - by Josh Bush
    I'm trying out asp.net mvc for a new project, and I ran across something odd. When I use the MVC UI helpers for textboxes, the values get persisted between calls. But, when I use a series of radio buttons, the checked state doesn't get persisted. Here's an example from my view. <li> <%=Html.RadioButton("providerType","1")%><label>Hospital</label> <%=Html.RadioButton("providerType","2")%><label>Facility</label> <%=Html.RadioButton("providerType","3")%><label>Physician</label> </li> When the form gets posted back, I build up an object with "ProviderType" as one of it's properties. The value on the object is getting set, and then I RedirectToAction with the provider as a argument. All is well, and I end up at a URL like "http://localhost/Provider/List?ProviderType=1" with ProviderType showing. The value gets persisted to the URL, but the UI helper isn't picking up the checked state. I'm having this problem with listbox, dropdownlist, and radiobutton. Textboxes pick up the values just fine. Do you see something I'm doing wrong? I'm assuming that the helpers will do this for me, but maybe I'll just have to take care of this on my own. I'm just feeling my way through this, so your input is appreciated. Edit: I just found the override for the SelectList constructor that takes a selected value. That took care of my dropdown issue I mentioned above. Edit #2: I found something that works, but it pains me to do it this way. I feel like this should be inferred. <li> <%=Html.RadioButton("ProviderType","1",Request["ProviderType"]=="1")%><label>Hospital</label> <%=Html.RadioButton("ProviderType", "2", Request["ProviderType"] == "2")%><label>Facility</label> <%=Html.RadioButton("ProviderType", "3", Request["ProviderType"] == "3")%><label>Physician</label> </li> Hopefully someone will come up with another way.

    Read the article

  • Program-wide data, C++

    - by bobobobo
    I'd like to make program-wide data in a C++ program. The easiest way to do it in C# is just public static members. C#: public static class DataContainer { public static Object data1 ; public static Object data2 ; } In C++ you can do the same thing C++ global data way#1: class DataContainer { public: static Object data1 ; static Object data2 ; } ; Object DataContainer::data1 ; Object DataContainer::data2 ; However there's also extern C++ global data way #2: class DataContainer { public: Object data1 ; Object data2 ; } ; extern DataContainer * dataContainer ; // instantiate in .cpp file Which is better, or possibly another way which I haven't thought about?

    Read the article

  • Location of global libraries for Python on Mac ?

    - by xTrol
    Hi, Im fighting with installation SIP for Python on Mac OS X. Finally after compilation and installation when I run console form folder of SIP (locally) I can import sipconfig, but when Im in other folder I cant - there is no module called sipconfig. My question is - Where is folder to which I have to copy modules if I want to have them available globally (like "import os"), or how I can check it, because location "/Library/Python/2.6/site-packages/" doesn`t work.

    Read the article

  • Global keylogger in Java

    - by Manish
    I'm writing an application which monitors the person’s mouse and keyboard. If they have not used the keyboard or mouse for 1 minute, it should pops up a message which says “You have not used the mouse or keyboard for 1 minute” and an OK button. How do I do this in Java?

    Read the article

  • How to use global caching in php?

    - by user63898
    ello all im new to php and server scripting ( coming from the java/cpp background ) my question is , if i like to be able to build some kind of single tone cache that will hold me data in memory in all the web application life , something that when i start the web server it will start main cache that will server the web application not inside sessions static cache like singletone map in c++/java that that leaves all the time what are my options ?

    Read the article

  • mysql query using global variables

    - by Carlos
    I am trying run a query to active the users account. I am not sure if I am having problem with the query itself or if there's something else that I dont know about. here is the code: if($_SESSION['lastid']&&$_SESSION['random']) { $check= mysql_query('SELECT * FROM members WHERE id= "$_SESSION[lastid]" AND random = " $_SESSION[random]"'); $checknum = mysql_num_rows($check); //$checknum = mysql_query($check) or die("Error: ". mysql_error(). " with query ". $check); if($checknum != 0) // run query to activate the account { $acti= mysql_query('UPDATE members SET activation = "1" WHERE id= "$_SESSION[lastid]"'); die('Your account has been activated. You may now log in!'); }else{ echo('Invalid id or activation code.') . ' lastid: ' .$_SESSION['lastid'] . ' random: ' .$_SESSION['random'] ; // die ('Invalid id or activation code.'); } }else{ die('Could not either find id or random number!'); } this is the warning I am getting from mysql: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /hermes/bosweb26b/b2501/servername/folder/file.php on line 30 but when I echo the variables out, I get the same values that are stored in the database.... Invalid id or activation code. lastid: 2 and random: 36308075 could someone please give me a hint? thank you.

    Read the article

  • dirname(__FILE__) VS setting global variable to directories

    - by SAFAD
    what are the pros and cons of using this : $globals['server_url'] = dirname(__FILE__); $globals['mainfiles'] = dirname(__FILE__).'/main'; and the pros and cons of using this : $globals['server_url'] = '/srv/www/htdocs/somwhere/'; $globals['mainfiles'] = '/srv/www/htdocs/somwhere/main'; And what do you suggest. by the way: these are set in config.php file which is called by other files as well, to stop directory conflicts when including files we use it like this : require_once($globals['server_url'].'/test.php');

    Read the article

  • Setting a Global Doctype

    - by Batfan
    Is it possible using PHP (I was thinking may the phpinfo file or a php.ini file) or an .htaccess file to set a doctype for an entire subdirectory? Basically, in a nutshell, I'm using a software that uses XSL templates to output data to a set of HTML files. Modifying the xsl:output tag to include the doctype breaks the template and therefore, does not work. Just adding the doctype in the XSL file, breaks it as well. I need the proper doctypes in place for my CSS to function properly, cross-browser. I realize that I could add the doctype to the HTML files after export but, I'm really striving to automate this process. Any thoughts?

    Read the article

  • Change and Maintain CSS Style of Button State

    - by TDDG
    I have 5 list items that act like tabs for a page stored in a Masterpage in a asp.net application. When the user selects a list item, I would like to redirect the the page, and change the class for that list item (tab) to show the active tab the user is on. What is the best way to dynamically change the class of the list item based on the user interaction with them, and maintain the state?

    Read the article

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