Search

You searched for the word(s): userid:795960

Matching Posts

  • Re: Get Values from Web User Control

    You need to create a property in your control to expose the selected item of the ddl. Something like this: public string SelectedValue { get { return yourDropDownList.SelectedValue; } } I have a post about exposing events in web user controls. Maybe it will help you get on the right track: http://www.gbogea.com/2008/05/17/exposing-events-in-web-user-controls
    Posted to Web Forms (Forum) by gbogea on 5/22/2009
  • Re: Setting a datasource on a repeater control Programatically

    You can change the DataSourceId the way you posted, note however that you should do it in the pageload, before the binding occurs. Here is an example on how to set the parameters programatically: http://msdn.microsoft.com/en-us/library/aa581787.aspx Hope this helps.
    Posted to Data Presentation Controls (Forum) by gbogea on 5/22/2009
  • Re: asp.net c# professional book

    The books with most advanced topics I have came across are: Pro ASP.NET 3.5 Professional ASP.NET 3.5 I've read them both and I can highly recommend either one.
    Posted to Book Reviews (Forum) by gbogea on 5/21/2009
  • Re: relative paths

    The ~ only works within asp.net controls. If you want to use regular html and still use a virtual path you may use the VirtualPathUtility class. Here is an example on how to do it: VirtualPathUtility.ToAbsolute("~/images/logo.png") Check msdn documentation for more info: http://msdn.microsoft.com/en-us/library/system.web.virtualpathutility.aspx
  • Re: Auto-Creating Extension Methods

    You can add methods to the class dynamically, you can however do something like this using reflection: public static class MyExtensions { public static void Call<T>( this IEnumerable<T> ienum, string methodName) { T first = ienum.FirstOrDefault(); if (first == null ) return ; MethodInfo method = first.GetType().GetMethod(methodName); foreach (var element in ienum) { method.Invoke(element, null ); } } } public class Dog { public void Bark() { // do the barking } public void Drool() {
    Posted to C# (Forum) by gbogea on 5/16/2009
  • Re: What event can I use after all controls are bound

    Try the PreRender event. Checkout this MSDN article about the page lifecycle: http://msdn.microsoft.com/en-us/library/ms178472.aspx
    Posted to Web Forms (Forum) by gbogea on 5/15/2009
  • Re: BLL classes don't show up in the objectdatasource wizard

    Check if your classes are declared as public . Put the attribute [System.ComponentModel.DataObject] over the class. If the objects still don't appear try to show all the classes on the wizard instead of just the data access classes. If even then it doesn't show there may be something wrong with your project. Hope this helps.
    Posted to Getting Started (Forum) by gbogea on 5/14/2009
  • Re: Typed DataRows, DataRelations, and Related Rows

    Hi Aaron, the DataRelations only work when you use DataTables that are part of the DataSet and when they have already been populated. The DataRelation will not go to the database to retrieve objects, it will only work with objects already loaded into memory. You need to do something like this: DataSetNorthwind dsn = new DataSetNorthwind(); TableAdapterProduct tap = new TableAdapterProduc(); tap.Fill(dsn.Product); TableAdapterCategory tac = new TableAdapterCategory(); tac.Fill(dsn.Category); Now that
  • Re: C# Generics and Boxing issue

    I had this happen to me but in my case the value in the session was not an int. Imagine that you put a decimal in the session then try to get it using the int type. This will give you an error when unboxing the type. One easy way to get around this problem is the following: public T Get<T>( string theKey) { object aSessionObject = Session[theKey]; if (aSessionObject == null ) { return default (T); } if (aSessionObject is ValueType) { return (T)Convert.ChangeType(aSessionObject, typeof (T));
    Posted to C# (Forum) by gbogea on 5/13/2009
  • Re: virtual path

    You need to check out url rewriting. It is probably what you need. weblogs. asp . net /scottgu/archive/2007/02/26/tip-trick- url - rewriting -with- asp - net . asp x www. gbogea .com/2009/05/01/lessons-learned-in- url - rewriting Hope it helps.
    Posted to Web Forms (Forum) by gbogea on 5/13/2009
Page 1 of 58 (574 items) 1 2 3 4 5 Next > ... Last »