.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Web controls and lines co existing together?

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :Windows Application
TextBox tb = new TextBox();
tb.Style.Add("position", "absolute");
tb.Style.Add("top", _XCurrentPosition.ToString() + "px");
tb.Style.Add("left", _YCurrentPosition.ToString() + "px");
tb.ID = i.ToString();

//Then draw a line on top
System.Drawing.Bitmap bmpImage = new System.Drawing.Bitmap(135, 135);                    
using (var g = Graphics.FromImage(bmpImage))
   g.DrawLine(Pens.Red, 0, 0, 135, 135);
Response.ContentType = "image/jpeg";
bmpImage.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);    

View Complete Post

More Related Resource Links

Advice Needed: 1-8 lines of repeating input controls - How should I do it?


Based on dynamic data, I'm going to have to display 1-8 rows of data input controls (a check box and several text boxes per row) and obtain input for all the rows I display.

I don't think a GridView is the way to do that (although if it is, please help educate me on why).  Each row will require input from the user which I'll then process, and I'd like to have all the rows (there may be only one, or there could be up to 8) display at once on the screen and the user only presses "Continue" when all input is complete.

What's the best way to accomplish this?  Can you point me to an example of how I might accomplish this?

Thanks in advance,


Hiding ASP controls on an existing web page


Hi everyone,

I got a big problem which is really giving me a headach....

Somehow I need to hide a control on an EXISTING WEB PAGE.

But the problem is, this control has code behind with VB.NET which I don't know how to read..  :(   (I use C#)

And this web page works as like an 'organic'. Controls are connected to all over other pages :(

This is the part to be not shown:

<td colspan="2">
                <uc4:LoginControl ID="LoginControl1" runat="server" HeaderText="Returning Users:"
                    HideIfLoggedIn="True" />       //Only this part
                    <uc5:AddressBook ID="AddressBook1" runat="server" TabIndex="1000" />

That uc4 prefix is defined at the top of the page:

<%@ Register Src="../../Controls/LoginControl.ascx" TagName="LoginControl" TagPrefix="uc4" %>

Code behind using this control part is here(aspx.vb) :

Protected Sub LoginCompleted(ByVal sender As Object, ByVal args As Controls.LoginCompleteEventArgs) Handles LoginControl1.LoginC

Custom Controls derived from existing controls - overriding default property values


I have some (probably very basic) questions about developing custom controls.  I am wanting to derive a set of button controls, and the first one I have started on is a "DeleteButton", that has a additional property (DeleteConfirmationText) that is built into the OnClientClick attribute.  To get that added, I overrode the Render method as follows:

protected override void Render(HtmlTextWriter writer)
            writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Format("return confirm('{0}');", this.DeleteConfirmationText));

This all works well.  Now, I will add some logic to make sure that there is some text in the DeleteConfirmationText property, but that isn't the intent of my question.

What I am also wanting to do is to override some of the default property values, so I added that to the default constructor:

public DeleteButton()
            // Default the command name, and the button text to "Delete".
            this.CausesValidation = false;
            this.CommandName = "Delete";
            this.Text = "Delete";

Now, in the designer in VS2008, and I look at the properties for the control, there isn'

Binding WPF Controls to an Entity Data Model

In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.

Custom Controls in C# .NET

Embedding user controls in a Windows form is just like adding a simple button or text box that are already provided with .NET. These basic controls were written essentially like you code your own controls. Typically the controls you design are to be used in multiple forms or to modularize your code. These reasons help reduce the amount of code you have to type as well as make it easier for you to change your implementation. There should almost never be any reason to duplicate code because it leaves a lot of room for bugs. So, implementing functionality specific to your control in the control's source code is a good idea. This reduces code duplication as well as modularize your code, which is a good programming guideline.

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

Using ASP.NET 3.5's ListView and DataPager Controls: Displaying Data with the ListView

Prior to ASP.NET 3.5, developers who needed to display a set of records could choose between the GridView, DataList, and Repeater controls. The GridView provides rich data features, but has a very boxy layout; the DataList and Repeater allow for a more flexible layout, but lack the "point and click" data features found in the GridView, DetailsView, and FormView controls. The ListView bridges the gap between layout flexibility and built-in data features.

This article, the first in a series of articles on the ListView and DataPager controls, looks at the ListView's many available templates and illustrates how to display data. Read on to learn more!

Binding WPF Controls to an Entity Data Model

In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.

Working with DropDownList and ListBox Controls in ASP.NET

"In my application i am using dropdownlist to display all categories from a table. When the user clicks this control I display all records in that category. Category table also contains column called color.

I wanted display some categories in dropdown list different color and others in different color using ASP.NET."-Anonymous

How to programmatically add controls to Windows forms at run time by using Visual C#

Create a Windows Forms Application
Start Visual Studio .NET or Visual Studio 2005 or a later version, and create a new Visual C# Windows Application project named WinControls. Form1 is added to the project by default.
Double-click Form1 to create and view the Form1_Load event procedure.
Add private instance variables to the Form1 class to work with common Windows controls. The Form1 class starts as follows:

Dynamically Create Controls in ASP.NET by Using Visual C# .NET

This article demonstrates how to dynamically create a control for an .aspx page. The sample project does the following:
Creates two TextBox controls.
Verifies that the contents (TextBox.text) and the attributes of the TextBox are saved across posts to the server.
Illustrates handling events that are posted by a dynamically-created control

Dynamically Create Controls in ASP.NET with Visual Basic .NET

This step-by-step article describes how to dynamically create controls for an ASPX Web page.

The sample project does the following:
It creates two TextBox controls.
It verifies that the TextBox contents (TextBox.text) and attributes are saved across posts to the server.
It describes how events that are posted by a dynamically created control are handled.

Creating Dialogs and Ribbon Controls for SharePoint 2010

SharePoint 2010 provides new user interface components, such as server ribbons, and the new dialog platform. As a developer, you can create controls for the server ribbon and dialog boxes for the dialog platform.

Draw lines excactly on physical device pixels

When you draw a line in WPF you will experience that they often appear blurry. The reason for this is the antialiasing system that spreads the line over multiple pixels if it doesn't align with physical device pixels.

How to bind GridView and DropDownList controls using DataTable object

In .net framework 2.0, you can load a DataTable in memory by consuming a data source using a DataReader. In this version you will find the flexibility in accessing the DataReader means write access code once and use again and again using DataReader. To see the functionality of DataTable consider an example that is created using VS2005.

all basic windows controls,wpf controls,silverlight application

here you will find all the information from basic.

Need help regarding C# / AJAX Dynamic Controls creation


radiobuttons is assigned before page init.. 

public partial class Default : System.Web.UI.Page
//Assign values as a specific Dynamic WebControl Creation.
List<RadioButton> radioButtons = new List<RadioButton>();
List<CheckBox> checkBoxes = new List<CheckBox>();

Then I created a class that would dynamically create a table containing the available flights depending on session.. (See CallPageLoad())

The placeholder and button is inside the UpdatePanel...

on the button inside the update panel, (btnSelect)

i have this code which works... 

protected void btnSelect_Click(object sender, EventArgs e)

Label1.Text = Convert.ToString(radioButtons.Count);

It detects the number of radiobuttons that were dynamically created...

But when I use the following code inside the BtnSelectClick event...

//PLS HELP.......
foreach (RadioButton button in radioButtons)
if (button.Checked == true)
Label1.Text = "You select... " + button;



It does not work even though t
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend