RSSCategory: C#

Concatenate strings in .aspx page

| November 5, 2011 | 0 Comments

Problem I am trying to set label value dynamically in .aspx page. Additionally I need to concatenate strings in the .aspx page. Solution We would need to use string.Concat() function for same. Here is solution for concatenating string values in .aspx page: Code Snippet for .aspx: Above code results in string as http://80Hello.

Continue Reading

Apply Style to ListItem in List Controls

| December 26, 2010 | 0 Comments

We can apply CSS class or styles to our List Controls (CheckBoxList, RadioButtonList, DropDownList and ListBox). But there is no way to add or apply style to ListItem within them in .aspx. So this article deals with how to add attributes to ListItems in all ListControls. We would apply required style or attributes at runtime […]

Continue Reading

Image in TextBox & RichTextBox

| December 25, 2010 | 0 Comments

This article deals with how to show Image in TextBox and RichTextBox control. I googled for same but found little or was too complex to implement as per my understanding. Well! The noteworthy point is that in either of methods shared here uses alternative solution. There is no such direct way to do. Second thing is […]

Continue Reading

Update database from DataGridView

| December 21, 2010 | 0 Comments

Most of time developer want their users to be able to update database from DataGridView in Window Forms. So this article deals with concept of how to update tables in database from DataGridView. The main task of updating database is done with the help of System.Data.SqlClient.SqlDataAdapter.Update() method.  System.Data.SqlClient.SqlCommandBuilder generates required command for SqlDataAdapter when Select […]

Continue Reading

How to access controls within User Control

| December 20, 2010 | 7 Comments

This article helps you to know step-by-step how to access controls within User Control from Asp.Net Page. 1. For this we would need to register our UserControl in Asp.Net Page. Code Snippet for UserControl: 2. And then in .aspx.cs page we can find the control within user control and caste it accordingly to use further in […]

Continue Reading

Modify MessageBox by MessageBoxManager

| December 18, 2010 | 0 Comments

You want to modify your default System.Windows.Forms.MessagBox look. You want to modify its fonts or its own size. In all you want to modify its appearance. And sometimes you wish to modify or change its functionality to some extent. Well … then there is some good news for you. But its not from Microsoft and […]

Continue Reading

Capture screen image by Screen shot in C#

| August 10, 2010 | 0 Comments

As the name suggests you can take screenshot by application Screen shot !!! Pre-Requisites Visual Studio 2005 or more .NET Framework 2.0 Concepts Covered Dynamic creation of Image on basis of Screen (represents Display Device) width and height. Handling most general error The process  cannot access  the file because it is being used by another  […]

Continue Reading

Display Image instead of CheckBox in DataGridView

| July 31, 2010 | 6 Comments

Well! I am not so much expert about the Window Controls. But sometimes we get stuck by problem which seems to easy. I tried lot on internet but I didn’t get solution as I wanted. After spending three to four hours ( yes it’s true) I found a solution which is working fine. So what’s […]

Continue Reading