dynamic

Generate Expression<> for filtering by a arbitrary property

I want to write filtering controls which take object type T and property name and return Expression<Func<T, bool>> that checks value of passed property. I don't want to use reflection because I'm afraid such expressions can't be used by EF. I can't use delegates because C# doesn't have delegates for properties. What can I do? Maybe I sho...

How to get the type for a class by sending just the name of the class instead of the class itself as the parameter?

Dim a as Type=GetType(className) would gimme the type. But I have only the name of the class as string. I want something like GetType("class1") which would return the type. ...

Loading jqgrid from qury with multiple joins

I am trying to load a sortable jqgrid 3.5 from a query with multiple joins in it and having much difficulty as I am a novice with both Linq and jqgrid. In order to allow for sorting I first was attempting to load it using dynamic sql. Since I am pulling columns from multiple tables I assume my return will be a class object which I will p...

What are static and dynamic variables / methods in OOP?

I am trying to better understand basic concepts in OOP. What are static and dynamic variables and methods in object-oriented programming? What is, for instance, the difference between using $this vs. double colon (::)? $this ($this->a_method()) Advantages: ?. Disadvantages: ? ... "this" is not self-documenting as in: $this->method_fr...

Dynamically get the result of a Func<T,bool> invocation

Hi, I am trying to serialize something based upon meeting particular criteria. To this end my original hope was to use attributes containing a lambda expression on an object's properties. However, as this cannot be done I've settled for having a Func<T,bool> member within the class and passing the type (or first parameter type) and na...

create dynamic link buttons in ListView

Hi, I am creating a search using listview. when user enter a word in search, I am generating a listview with the results. Now, there will be tags in each listview row. When, user clicks the tag, again a search happens using the value in the tag. There may be any number of tags for each listview row. I have to generate linkbuttons for t...

How to tell if a .NET assembly is dynamic?

When iterating through a set of assemblies, e.g. AppDomain.CurrentDomain.GetAssemblies(), dynamic assemblies will throw a NotSuportedException if you try to access properties like CodeBase. How can you tell that an assembly is dynamic without triggering and catching the NotSupportedException? ...

Constructing Dynamic Properties at Runtime in VB .NET

Is there a way to dynamically create properties at runtime in VB .NET using introspection? e.g. Suppose I had a class Public Class Foo Public Property Bar() As String get ... end get set(ByVal value As String) ... end set End Class Is there a way to create property Bar at runtime? T...

ASP.NET putting dynamic controls on page in reverse messes up events

I have this weird problem when putting textboxes on the page in reverse. The whole event system is messed up. Changing one textbox fires TextChange on all textboxes. I can fix this by putting the controls in a list first and then call add while iterating trough the list in reverse. But i just want to know why this fails. Heres some code ...

Dynamically created dynamic RadioButtonsList

I'm working on a fun 'survey' form and am trying to break up the tedium by over complicating the process. I have a group of radiobuttonlists that I want to dynamically create from a string of names and a string of values. The values is not a problem. It's creating all the radiobuttonlists that I can't figure out. For instance I could j...

how to create 5 buttons and assign individual click events dynamically in c#

Hello Members, I need your help in C# code. I need to create 5 buttons dynamically on windows form and each button should respond to click event. I tried it but all buttons are responding to same event. ...

dynamic casting?

I need a way to cast an object to a type that is not know at compiler time. something like this: object obj; public (type of obj) Obj { get { return obj } set { obj = (type of obj)value; } } The only thing that is know is that obj is a value type. I doubt that something like this would be pos...

dynamic page caching- show redirected html cache page or show the dynamic page?

would like your comments. Eg: When user first visit www.testing.com/productdetailpage.asp I will use caching- store the whole page into productdetailpage.html When the user go to reopen productdetailpage.asp, user will be redirected to www.testing.com/productdetailpage.html It means they will see productdetailpage.html, not .asp Is ...

How to get value of dynamicaly added column of datagridview at time of postback!!

Hello, I have made a one form with functionality to create grid view dynamically. i have used concept of "how to create template columns dynamically in a grid view" Link : http://www.codeproject.com/KB/aspnet/DynamicTemplateColumn.aspx its working good. i am creating control run time set the different property of control and bind it...

Creating a WPF button with a dynamic name in XAML

I have a bound ListBox in WPF where each item has an up / down button to move the item up or down in the list box. However I need to know which button fired the event so I want to set the name of the button to "UpButton" + listBoxItem.Text type of thing. Here's a simplified version of the XAML <ListBox> <ListBox.ItemTemplate> ...

In this scenario, how to frame a common function and parameterize casting?

These are the 2 sets of activities : //#1 List<object> AFilterObject = A_List.SelectedList; List<A> AFilters = new List<A>(); foreach (Aitem in AFilterObject ) { //Do activity X } //#2 List<object> BFilterObj = B_List.SelectedList; List<B> payopFilters =...

Are there security issues when dynamically loading external content into a page using jQuery?

I'm building a site and I would like to have external content dynamically loaded in a div using jQuery. The content could be a google search page, where one can navigate without actually leaving the site. Could someone exploit this and drive to a content of his own and run malicious code inside my site? Are there ways to prevent this? Is...

how to create an image of dynamic data in php

I have to make an image of a dynamic page i.e. the page keeps on changing in every 5 minutes. I want to make images of that very page that keeps on changing so that i can have its records saved in the form of images. How can i do that using php?? i have no idea about this and a little elaboration in answers will be highly appreciated!!...

Dynamic Script Tags for JSON requests... detecting if there is a XXX error?

I do a bunch of json requests with dynamic script tags. Is it possible to detect if there's an error in the request (eg. 503 error, 404 error) and run something on detection of the error? ...

Is there a way of making normal links automatically load through ajax, rather than normally?

I haven't explained this well. But what i mean is, if I have an ajax script that loads the content of a page in a DIV element, through the function 'loadpage('whatever.php');, instead of going around manually doing this to all links, is there a way of having a script that automatically makes all regular links load through that ajax func...