Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

minhpc_bk

@minhpc_bk
About
Posts
4.4k
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • My web service doesn't seem to update when I compile it
    M minhpc_bk

    Do you update the service reference at the client side?

    ASP.NET visual-studio question announcement workspace

  • Who's the expert in ASP.NET
    M minhpc_bk

    Kusal wrote:

    Who's the expert in ASP.NET

    Scott Guthrie[^]

    Kusal wrote:

    My project has this files - Web.config, Global.asax What are the important in here. I need get complete idea about content in this file. Any one can pls give clear idea or submit articles or links. And also give idea about Forms Authentication / Windows Authentication ?

    MSDN[^]

    ASP.NET csharp asp-net security question

  • Can't retrieve data out of a GridView Control
    M minhpc_bk

    Actually, you can set the DataKeyNames property either in the control definition or in code, the values should be taken from the result data reader. For example:

    GridView1.DataKeyNames = new string[] { "Id" };

    ....

    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
    object key = GridView1.DataKeys[e.NewEditIndex].Value;
    }

    ASP.NET database csharp css asp-net sql-server

  • Setting property via Reflection
    M minhpc_bk

    In this case, you should use the the type converter of the property to convert a string value, this way will work not just with the primitive types, but also with custom types. To get the TypeConverter[^], you can use the TypeDescriptor[^], your sample code is updated a bit like this:

    public void SetProperty(Control control, string propertyname, string propertyvalue)
    {
    Type type = control.GetType();
    System.Reflection.PropertyInfo pi = type.GetProperty(propertyname);

    TypeConverter converter = TypeDescriptor.GetConverter(pi.PropertyType);
    object value = converter.ConvertFromInvariantString(propertyvalue);
                
    //object value = Convert.ChangeType(propertyvalue, pi.PropertyType);
               
    pi.SetValue(control, value, null);
    

    }

    ASP.NET tutorial question

  • Setting property via Reflection
    M minhpc_bk

    You might want to see the ParseControl[^] method.

    ASP.NET tutorial question

  • Setting property via Reflection
    M minhpc_bk

    szukuro wrote:

    Anyone else know a better solution?

    As long as I I don't know what your context is, for example why you need reflection here, then IMO it's hard to say this is a good/bad choice or whether there is a better one.

    ASP.NET tutorial question

  • Dynamically Updating web.config
    M minhpc_bk

    ASP.NET Configuration API [^]

    ASP.NET question csharp asp-net announcement

  • 2.0 UserCtrol and Styles
    M minhpc_bk

    If you want to make it work with the designer, you'll have to use a custom control (CompositeControl) instead as the design-time support for the usercontrol is limited in VS, it always looks at the base class UserControl to parse any nested elements you define in your user control.

    ASP.NET question html wpf design sysadmin

  • Can't retrieve data out of a GridView Control
    M minhpc_bk

    Quecumber256 wrote:

    The problem I’m having is I don’t know how to read the data stored in the first column on the GridView Control.

    + You can get reference to the first cell of a row to get the value. + Another option is to store the key values using the DataKeyNames[^] property and you can access the value from the DataKeys collection.

    ASP.NET database csharp css asp-net sql-server

  • Editing server-side Excel s/sheet in ASP.Net 2.0 Page - how?
    M minhpc_bk

    IMHO, you might want to check out a couple of things: + Use Webdav to manage/edit the files. + Show the file contents at the client side in the Excel-like display, here you can might want to look for some custom grid controls supporting Excel-like style, then the client can edit in the web page and finally submit the changes to the server. + You can allow the user to open the Excel file on their box with the Excel application, then you can use an Excel add-in to capture the Save action to send the edited file to the server.

    ASP.NET question csharp html asp-net sysadmin

  • Problem with CompareValidator to compare TextBox control with Label control
    M minhpc_bk

    That's because the Label control is not marked with the ValidationProperty[^]. So you either a) customize the label control or b) use a invisible textbox to contain the value beside the Label so that you can validate the textbox.

    ASP.NET help question

  • custom section in configuration files
    M minhpc_bk

    red60mans wrote:

    1)PublicKeyToken --- Is this the one generated thru sn.exe???

    You can see the PublicKeyToken value when your assembly is made strong-named, otherwise it's a null value.

    red60mans wrote:

    2)System.Configuration.AppSettingsSection --- Is this any name or should it be my class name

    It should be your fully qualified name of your class as you here want to create a custom config entry.

    red60mans wrote:

    1. System.Configuration --- what about this ???

    This is the namespace containing your custom config handler class. Basically, when you define a custom configuration section, you'll have to specify the handler for this section and you also need to tell the system about how to locate the type of your class. For more information, see ASP.NET Configuration [^]

    ASP.NET question announcement workspace

  • HTTPHandler Not working on IIS [modified]
    M minhpc_bk

    How do you define your custom handler? How do you configure that handler?

    ASP.NET sysadmin windows-admin

  • system.web.extensions and web.config [modified]
    M minhpc_bk

    You should use the first one as the name Microsoft.Web.Extensions is changed in the RTM, more details can be found here[^]

    ASP.NET csharp question announcement workspace

  • How should I pass a variable to a "controlid" on a ControlParameter.
    M minhpc_bk

    Basically, the ControlParameter does not support the DataBinding event so you cannot use a data binding expression to set the ControlID property of the parameter, and your choice is to do this in code. Also, you need to be aware that the ControlID property needs to be updated before it is used to populate the value, if it happens after then you'll get an error as the specified control is not found. Normally, the ControlParameter uses its ControlID property to evaluate the parameter value in the overridable Evaluate method which occurs in the LoadComplete event of the Page instance. So you can put your code to update the ControlID in the events (of the data source control or the Page instance) that happens before the Page_LoadComplete and of cource after the data source control is built. For example, you can use the Load event of the data source control:

    protected void SqlDataSource1_Load(object sender, EventArgs e)
    {
    //Assuming the ControlPatameter is the first one in the UpdateParameter collection.
    ControlParameter para = SqlDataSource1.UpdateParameters[0] as ControlParameter;
    para.ControlID = "GridView1$ctl0" + (GridView1.EditIndex + 2) + "$DropDownList1";
    }

    where the EditIndex property of the GridView control will give you the index of the row being edited, this is a zero-based value, however the index used in the UniqueID of the dropdownlist is a one-based value and it is counted from the header row. Therefore, you have to add 2 to the EditIndex to get the correct number used in the UniqueID.

    ASP.NET question

  • How do i pass the SelectedValue/Index of a DropDownList in a GridViews EditItem Template to a Control Parameter?
    M minhpc_bk

    Web Forms Control Identification[^] Using Parameters with Data Source Controls[^] http://www.nikhilk.net/DataSourceControlParameters.aspx[^] http://aspnet.4guysfromrolla.com/articles/110106-1.aspx[^]

    ASP.NET question database wpf wcf help

  • Atlas update panel and Web Parts
    M minhpc_bk

    Hi Mark, From what I know the WebPart is still under development, it means that it's in the future features of the ASP.NET AJAX and this error (as well as other errors with the web part/ajax) is still remained in the January CTP.

    ASP.NET announcement csharp asp-net sharepoint com

  • How do i pass the SelectedValue/Index of a DropDownList in a GridViews EditItem Template to a Control Parameter?
    M minhpc_bk

    Because you want to get the value from the dropdownlist then the ControlID should point to this control, not the GridView. However, the dropdownlist is contained inside the GridView, therefore the value of the ControlID will be the uniqueID of the dropdownlist including the id of the containers. So it should be something like gvOutgoing$ctl02$ddlRecorded (or you can replace the $ with the :). There's one more important thing is that the uniqueId of the dropdownlist varies from row to row, so you'll have to update the ControlID dynamically according to which row is being edited.

    ASP.NET question database wpf wcf help

  • ASP.net/SQL newbie Question
    M minhpc_bk

    Planker wrote:

    command.BeginExecuteNonQuery(); connection.Close();

    You make an asynchronous call to insert data, but you close the connection right after that then how data can be inserted into DB. You might also double check the parameter name gmaePlatform as well.

    ASP.NET database help csharp asp-net com

  • play video file which is binary form in database
    M minhpc_bk

    I don't have any sample code right here in my hand, but you might want to search on the net or write your own as it's simple enough. Basically, you normally use the media file ending with .mp3, .wav ...., to feed the media player, but now you specify a web page, say download.aspx instead (perhaps along with the id of the media file in the query string). Then in the download.aspx file, you just write some code to query the selected media file contents from DB based on the id passed in the query string. You finally write out the binary data to the Response object and that's it.

    ASP.NET database sql-server help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups