Search Results

Search found 7104 results on 285 pages for 'dynamic usercontrols'.

Page 100/285 | < Previous Page | 96 97 98 99 100 101 102 103 104 105 106 107  | Next Page >

  • How to Retrieve Values of A Dynamically Created Control's Child Controls on PostBack?

    - by Jordan
    Given: I have a custom server control in the markup of an aspx page. This control creates child controls in its CreateChildControls() method (e.g. it retrieves content from a database and based on that content dynamically creates either a CheckBoxList or a RadioButtonList) Now I understand that I cannot access the dynamically created controls on postback unless I add them again on Page_Init or Page_PreInit (as per here). My question is, how do I add them again explicitly in Page_Init or Page_PreInit if they are just going to be added yet again when we get around to calling Render() on each of the custom server controls? I'm very certain this is not a unique problem, so there must be a best practice way of doing it...I just don't know what it is :/

    Read the article

  • How can I set where a Qt app finds a Qt module?

    - by yan bellavance
    I would like to include libQtGui.so.4 libQtNetwork.so.4 and libQtCore.so.4 in the same directory as where my app resides. How would I make Qt understand this? y purpose is to have a standalone app that uses shared libraries update: im gonna try to first remove them with QT-=gui etc and seeif I can add mine back after

    Read the article

  • Inheritence and usage of dynamic_cast

    - by Mewzer
    Hello, Suppose I have 3 classes as follows (as this is an example, it will not compile!): class Base { public: Base(){} virtual ~Base(){} virtual void DoSomething() = 0; virtual void DoSomethingElse() = 0; }; class Derived1 { public: Derived1(){} virtual ~Derived1(){} virtual void DoSomething(){ ... } virtual void DoSomethingElse(){ ... } virtual void SpecialD1DoSomething{ ... } }; class Derived2 { public: Derived2(){} virtual ~Derived2(){} virtual void DoSomething(){ ... } virtual void DoSomethingElse(){ ... } virtual void SpecialD2DoSomething{ ... } }; I want to create an instance of Derived1 or Derived2 depending on some setting that is not available until run-time. As I cannot determine the derived type until run-time, then do you think the following is bad practice?... class X { public: .... void GetConfigurationValue() { .... // Get configuration setting, I need a "Derived1" b = new Derived1(); // Now I want to call the special DoSomething for Derived1 (dynamic_cast<Derived1*>(b))->SpecialD1DoSomething(); } private: Base* b; }; I have generally read that usage of dynamic_cast is bad, but as I said, I don't know which type to create until run-time. Please help!

    Read the article

  • How can I get my div id to reload via ajax and jquery

    - by Matt Nathanson
    I'm creating a CMS using jQuery and AJAX. When I click, my "Add Campaign" buttom, it creates a unique client ID in the DB and on a hard reload, the new client shows up in its container. I am trying to use ajax to reload the container on the fly and I'm not having the exact luck i am hoping for. I can get it to reload, but it's like it's pulling in descriptions of each of the clients as well! function AddNewClient() { dataToLoad = 'clientID=' + clientID + '&addClient=yes'; $.ajax({ type: 'post', url: '/clients/controller.php', datatype: 'html', data: dataToLoad, target: ('#clientssidebar'), async: false, success: function(html){ $('#clientssidebar').html(html); }, error: function() { alert('An error occured!'); } }); };

    Read the article

  • What's the proper workaround for creating a div with a table in it with images in the table?

    - by Noor
    I want this: <div id="display"> <div id="slideshow1"> <table cellspacing=0><tr><td style="height:200px;padding:0;vertical-align:middle"> <img ... /> </td></tr></table> </div> </div> And I'm using this: var thelistt = localStorage.getItem('thelist') var trt = document.createElement("div"); trt.setAttribute("Id","slideshow1"); trt.className="pics"; $('#display').append(trt); var tble = document.createElement("table"); tble.setAttribute("cellspacing","0"); tble.innerHTML = "<tr><td style='height:200px;padding:0;vertical-align:middle'>"; $('#slideshow1').append(tble); trt.innerHTML += thelistt; This creates a div, then a table, closes the table, then images, then closes div.. Isn't there a smoother way to not do all this, if someone'd take a look at my current code i''m sure you'd get a good laugh : http://hem.bredband.net/noor/bildspelet3.html (you need to click on edit and put in two or more urls directly to images)

    Read the article

  • Can I make the compiler and the CLR ignore non implemented interfaces on my types?

    - by Thiado de Arruda
    I would like to define a type implementing a certain interface, however I would only implement it in a proxy at runtime. I can see two obstacles in this scenario : 1-Make the compiler ignore non implemented interfaces. 2-Make the CLR ignore(or at least delay) the TypeLoadException with the following description : "Method SOMEMETHOD in type SOMETYPE from assembly SOMEASSEMBLY does not have an implementation." Is something like this possible?

    Read the article

  • Problems with Database Search Code (asp.net vb)

    - by Phil
    Here is a sample of my database search code: Dim sql As String = "Select * From Table Where " Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim andor As Boolean = AndOr1.SelectedValue 'selection can be AND or OR (0 / 1) 'Code for when the user selects AND If NameSearch.Text.ToString IsNot String.Empty And andor = 0 Then sql += "Surname LIKE '%" & name & "%' AND " End If If EmailSearch.Text.ToString IsNot String.Empty And andor = 0 Then sql += "Email LIKE '%" & email & "%' AND " End If If CitySearchBox.Text.ToString IsNot String.Empty And andor = 0 Then sql += "City LIKE '%" & city & "%' AND " End If 'Code for when the user selects OR If NameSearch.Text.ToString IsNot String.Empty And andor = 1 Then sql += "(Surname LIKE '%" & name & "%' OR " End If If EmailSearch.Text.ToString IsNot String.Empty And andor = 1 Then sql += "Email LIKE '%" & email & "%') OR " End If If CitySearchBox.Text.ToString IsNot String.Empty And andor = 1 Then sql += "(City LIKE '%" & city & "%' OR " End If sql = CleanString(sql) End Sub When the user selects AND (as andor.selectedvalue(0)) then the sql is produced fine like this; Select * From Table Where Surname LIKE '%test%' AND Email LIKE '%test%' AND City LIKE '%test%' But if the user selects OR (as andor.selectedvalue(1)), nothing is outputted except; Select * From Table Where Im sure the controls have values so are not string.empty and when the user selects OR the correct value 1 is being assigned to andor.

    Read the article

  • Can I use the [] operator in C++ to create virtual arrays

    - by Shane MacLaughlin
    I have a large code base, originally C ported to C++ many years ago, that is operating on a number of large arrays of spatial data. These arrays contain structs representing point and triangle entities that represent surface models. I need to refactor the code such that the specific way these entities are stored internally varies for specific scenarios. For example if the points lie on a regular flat grid, I don't need to store the X and Y coordinates, as they can be calculated on the fly, as can the triangles. Similarly, I want to take advantage of out of core tools such as STXXL for storage. The simplest way of doing this is replacing array access with put and get type functions, e.g. point[i].x = XV; becomes Point p = GetPoint(i); p.x = XV; PutPoint(i,p); As you can imagine, this is a very tedious refactor on a large code base, prone to all sorts of errors en route. What I'd like to do is write a class that mimics the array by overloading the [] operator. As the arrays already live on the heap, and move around with reallocs, the code already assumes that references into the array such as point *p = point + i; may not be used. Is this class feasible to write? For example writing the methods below in terms of the [] operator; void MyClass::PutPoint(int Index, Point p) { if (m_StorageStrategy == RegularGrid) { int xoffs,yoffs; ComputeGridFromIndex(Index,xoffs,yoffs); StoreGridPoint(xoffs,yoffs,p.z); } else m_PointArray[Index] = p; } } Point MyClass::GetPoint(int Index) { if (m_StorageStrategy == RegularGrid) { int xoffs,yoffs; ComputeGridFromIndex(Index,xoffs,yoffs); return GetGridPoint(xoffs,yoffs); // GetGridPoint returns Point } else return m_PointArray[Index]; } } My concern is that all the array classes I've seen tend to pass by reference, whereas I think I'll have to pass structs by value. I think it should work put other than performance, can anyone see any major pitfalls with this approach. n.b. the reason I have to pass by value is to get point[a].z = point[b].z + point[c].z to work correctly where the underlying storage type varies.

    Read the article

  • SQL Server pivots? some way to set column names to values within a row

    - by ccsimpson3
    I am building a system of multiple trackers that are going to use a lot of the same columns so there is a table for the trackers, the tracker columns, then a cross reference for which columns go with which tracker, when a user inserts a tracker row the different column values are stored in multiple rows that share the same record id and store both the value and the name of the particular column. I need to find a way to dynamically change the column name of the value to be the column name that is stored in the same row. i.e. id | value | name ------------------ 23 | red | color 23 | fast | speed needs to look like this. id | color | speed ------------------ 23 | red | fast Any help is greatly appreciated, thank you.

    Read the article

  • Identify html tags for image, video in text and convert them into images, videos while laying dynami

    - by neha
    Hi all, In my app I need to lay some text which I'm getting from a parsed data. Currently I'm currently laying it in a label. The problem is there are going to be some html tags indicating an image [along with its url] and videos etc in that plaintext. What is a good way to handle this identifying images and videos tags and laying corresponding images and videos along with rest of the plaintext dynamically? Thanx in advance.

    Read the article

  • How do I make a GUI that behaves like this?

    - by Karl Knechtel
    This is difficult to explain without illustration, so - behold, an illustration, cobbled together from screenshots of a few hello-world examples and a lot of Paint work: I have started out using Windows Forms on .NET (via IronPython, but that shouldn't be important), and haven't been able to figure out very much. GUI libraries in general are very intimidating, simply because every class has so many possible attributes. Documentation is good at explaining what everything does, but not so good at helping you figure out what you need. I will be assembling the GUI dynamically, but I'm not expecting that to be the hard part. The sticking points for me right now are: How do I get text labels to size themselves automatically to the width of the contained text (so that the text doesn't clip, and I also don't reserve unnecessary space for them when resizing the window)? How do I make the vertical scrollbar always appear? Setting the VScroll property (why is this protected when AutoScroll is public, BTW?) doesn't seem to do anything. How come the horizontal scrollbar is not added by AutoScroll when contents are laid out vertically (via Dock = DockStyle.Top)? I can use a minimum size for panels to prevent the label and corresponding control from overlapping when the window is shrunk horizontally, but then the scrollbar doesn't appear and the control is inaccessible. How can I put limits on window resizing (e.g. set a minimum width) without disabling it completely? (Just set minimum/maximum sizes for the Form?) Related to that, is there any way to set minimum/maximum widths or heights without setting a minimum/maximum size (i.e. can I constrain the size in only one dimension)? Is there a built-in control suitable for hex editing or am I going to have to build something myself? ... And should I be using something else (perhaps something more capable?) I've heard WPF mentioned, but I understand that this involves XML and I really want to build a GUI from XML - I already have data in an object graph, and doing some kind of weird XML pseudo-serialization (in Python, no less!) in order to create a GUI seems incredibly roundabout.

    Read the article

  • CodeIgniter: Where should a particular functionality go ?

    - by Samnan
    I have an application in codeigniter and a page needs to perform the following tasks 1 - controller decides which model to use based of the url and parameters 2 - controller loads the model and get the data from it 3 - controller formats the data in a particular format, depending on the items in it 4 - controller loads a common view, which will display the data (formatted data contains simple display fields) now there is a search page, which needs to do a text query against all of the possible text fields in database in all tables. It needs to show each type of data in its own formatted output on a single page as a list. The problem: The search controller can do the search, dynamically load model for each record type, and get the data from model. Problem comes when the data needs to be formatted. It looks that ideally the search controller should load another controller which will provide formatted data ... There is where it gets out of control ... My question is: What am I doing wrong? Is there any better way to do this? How would you do the same to solve the problem?

    Read the article

  • Changing type of object in a conditional

    - by David Doria
    I'm having a bit of trouble with dynamic_casting. I need to determine at runtime the type of an object. Here is a demo: include include class PersonClass { public: std::string Name; virtual void test(){}; //it is annoying that this has to be here... }; class LawyerClass : public PersonClass { public: void GoToCourt(){}; }; class DoctorClass : public PersonClass { public: void GoToSurgery(){}; }; int main(int argc, char *argv[]) { PersonClass* person = new PersonClass; if(true) { person = dynamic_cast(person); } else { person = dynamic_cast(person); } person-GoToCourt(); return 0; } I would like to do the above. The only legal way I found to do it is to define all of the objects before hand: PersonClass* person = new PersonClass; LawyerClass* lawyer; DoctorClass* doctor; if(true) { lawyer = dynamic_cast(person); } else { doctor = dynamic_cast(person); } if(true) { lawyer-GoToCourt(); } The main problem with this (besides having to define a bunch of objects that won't be use) is that I have to change the name of the 'person' variable. Is there a better way? (I am not allowed to change any of the classes (Person, Lawyer, or Doctor) because they are part of a library that people who will use my code have and won't want to change). Thanks, Dave

    Read the article

  • Boost Test dynamically or statically linked?

    - by Halt
    We use Boost statically linked with our app but now I wan't to use Boost Test with an external test runner and that requires the tests themselves to link dynamically with Boost.Test through the use of the required BOOST_TEST_DYN_LINK define. Is this going to be a problem or is the way Boost Test links completely unrelated to the way the other Boost libraries are linked? Thx.

    Read the article

  • What prevents a user from adding controls to an ASP.NET page client side?

    - by Curtis White
    This goes back to my other question which I thought was sufficiently answers but upon reflect am not sure that it was (sorry). Backgrounder: I am generating a form dynamically. I am pulling from the database the controls. I must associate each control with a database ID which is not the user's session id. I do this currently by storing my ID in the ID for the web control with some other stuff to make it unique/clear what I am doing. On the post back, I iterate through all the controls on my web page checking for my special identifier, ie, MyGeneratedTextBox_ID_Unique. This process enables for 2 important steps, identifying the control was one I generated and also getting the ID for this input field. And, all of this works but I'm still concerned about the security of it. I do not see a security issue with showing the actual database ID's in this case, although agree it is not desirable. However, I am concerned of the following possibilities: If a user could add a nefarious control to my collection and use that for a SQL injection attack. More academic, but if a user could somehow store data for fields they do not have access too by changing the id's. I agree this is a "hack" of a way to do it. But my question is, is it a security risk and is there an 'easy' way to do it in a less hack way? I assume that only the controls that are created/instantiated on the page are added to the controls list.. thus all controls must be created server side and thus the security issue is address but just wanted to validate. Thanks again. PS: I could see adding a property for each control and encrypting the viewstate would be a little more secure.

    Read the article

  • Download button that send application to blackberry and asks everyone else to register???

    - by Stefan
    Hello all I would like to know your opinions on how to handle this. I need to create a link or advertisement that offers a phone app to be downloaded. I need that users who are viewing the page with their blackberry receive the download when they click the button but everyone else who would be viewing the page would get a form which asks that they insert a phone number to send the application to. Has anyone else already tackled this or something similar?

    Read the article

  • javascript - how to call a function newly added from ajax

    - by strike_noir
    I have a coding difficulty which have been asked in this forum before: Calling a JavaScript function returned from a Ajax response But I didn't find the answers quite satisfying. To be more precise of the problem I'm dealing, here is the details: I dynamically load a document (HTML and javascript) using jquery var url = 'document.php'; $('#container').load(url); And then I want to call the functions from that document.php. Due to my requirement, I don't want to call the function after the documents' loaded, but rather to call it later when I need it. Because it was dynamically loaded, the DOM doesn't recognize the functions. How to properly call this function? Thank you

    Read the article

  • Default Sorting in DynamicData

    - by Jens A.
    I am using DynamicData in the version that shipped with VS2008. In the default List view, the data is sorted by order of entry into the database. I'd like to get it sorted by a field of a specific name (descending). As a last resort I tried to use the OrderByParameter of the LinqDataSource with a QueryStringParameter, but I could not get it to sort anything. =) Is there an easy way to accomplish this?

    Read the article

  • algorithm to find longest non-overlapping sequences

    - by msalvadores
    I am trying to find the best way to solve the following problem. By best way I mean less complex. As an input a list of tuples (start,length) such: [(0,5),(0,1),(1,9),(5,5),(5,7),(10,1)] Each element represets a sequence by its start and length, for example (5,7) is equivalent to the sequence (5,6,7,8,9,10,11) - a list of 7 elements starting with 5. One can assume that the tuples are sorted by the start element. The output should return a non-overlapping combination of tuples that represent the longest continuos sequences(s). This means that, a solution is a subset of ranges with no overlaps and no gaps and is the longest possible - there could be more than one though. For example for the given input the solution is: [(0,5),(5,7)] equivalent to (0,1,2,3,4,5,6,7,8,9,10,11) is it backtracking the best approach to solve this problem ? I'm interested in any different approaches that people could suggest. Also if anyone knows a formal reference of this problem or another one that is similar I'd like to get references. BTW - this is not homework. Edit Just to avoid some mistakes this is another example of expected behaviour for an input like [(0,1),(1,7),(3,20),(8,5)] the right answer is [(3,20)] equivalent to (3,4,5,..,22) with length 20. Some of the answers received would give [(0,1),(1,7),(8,5)] equivalent to (0,1,2,...,11,12) as right answer. But this last answer is not correct because is shorter than [(3,20)].

    Read the article

  • Stored Connection Strings per user

    - by pehaada
    In the past I've used a Singleton Pattern to load the connection string when the application starts via the global.asa file. I have a project now where each user has a unique connection string to the database. I would like to load this connection string once. The issue is that the singleton pattern will not work for me since each user has there own connection string. Basically the connection string is created dynamically. I do not want to store it is session. If anyway has a clever way of doing this in .NET let me know ?

    Read the article

  • In Java how instance of and type cast(i.e (ClassName)) works on proxy object ?

    - by learner
    Java generates a proxy class for a given interface and provides the instance of the proxy class. But when we type cast the proxy object to our specific Object, how java handles this internally? Is this treated as special scenario? For example I have class 'OriginalClass' and it implements 'OriginalInterface', when I create proxy object by passing 'OriginalInterface' interface java created proxy class 'ProxyClass' using methods in the provided interface and provides object of this class(i.e ProxyClass). If my understanding is correct then can you please answer following queries 1) When I type cast object of ProxyClass to my class OriginalClass this works, but how java is allowing this? Same in case of instace of? 2) As my knowledge java creates a proxy class only with the methods, but what happen when I try to access attributes on this object? 3) Only interface methods are getting implemented in Proxy, but what happens when I try to access a method which not in interface and only mentioned in the class? Thanks, Student

    Read the article

  • Constructors for C++ objects

    - by sasquatch
    I have class Person as following : class Person { char* name; int age; }; Now I need to add two contructors. One taking no arguments, that inserts field values to dynamically allocated resources. Second taking (char*, int) arguments initialized by initialization list. Last part is to define a destructor showing information about destroying objects and deallocating dynamically allocated resources. How to perform this task ? That's what I already have : class Person { char* name; int age; public: Person(){ this->name = new *char; this->age = new int; } Person(char* c, int i){ } };

    Read the article

< Previous Page | 96 97 98 99 100 101 102 103 104 105 106 107  | Next Page >