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

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

how to create dropdownlist user control(acsx) and fill from database

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net

how to create dropdownlist user control(acsx) and fill from database

View Complete Post

More Related Resource Links

how to fill user control(.ascx) (Dropdown from Database)


i am created a user control(.ascx)

<span><asp:DropDownList ID="Drop_DocType" runat="server"  DataTextField="DOCTYPE"DataValueField="DOCTYPE"/></span>

  how to fill it rom database and where i put soure code

how to get an array of all the asp.net textbox control inside create user wizard control?



How can I get all the textboxes inside a create user wizard control using getElementsByTagName().

Below is my JQuery code:

<script type="text/javascript">
        function addLoadEvent(func) {
            var oldonload = window.onload;
            if (typeof window.onload != 'function') {
                window.onload = func;
            } else {
                window.onload = function() {

        function prepareInputsForHints() {
            var inputs = document.getElementsByTagName("asp:TextBox");
            for (var i = 0; i < inputs.length; i++) {
                inputs[i].onfocus = function() {
                    this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
                inputs[i].onblur = function() {
                    this.parentNode.getElementsByTagName("span")[0].style.display = "none";



<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

How to fill out a form as another user , while using profiles database


I have created an InfoPath 2007 form. It works great.. I have 5 data connections to sharepoint lists and profile's database. The form displays public data (profile database) about the user, such as name, manager.. etc.

What I would like to do is have an option on the form that says " If you are not this person , click here" , manually type the persons last name , and bring up their information.

Basically , there are some people who will have someone else fill the form out for them. But I don't want them to be giving out their username and password to the system.

I want the ability to fill out a form as another user without logging off sharepoint. 

Create user is creating aspxxxx.mdf database in my app_data folder


I had already setup roles for my pages and requirements call for ability to manage and create users.

So i was looking at code that allows you to do so using membership, even though i got the page to work, it was creating a database in my app_data folder.. i already have SQLExpress setup with the asp schema, but cant figure out how to get my application to use that instead of creating the db in the folder?

What am i missing or doing wrong?

I have the following setup in my web.config file..

		<authentication mode="Windows"/>
			<deny users="?"/>
        <add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

Dropdownlist as user control

HiIn an inventory application am using a dropdownlist for selecting the customer.So the customer names are populating from the database table(sql ie setting datasource). Now  I  think its better to create the dropdownlist as a usercontrol in asp.net so that i can just drag the customer dropdownlist to every page .Also i have to get the selected index change event and many more events.Can we achieve that?If so How. plz share the sample code.Thanks in advance

Create new database as a user instance

Hello...Is there any way to create a new database directly as a user instance. I guess this means creating a new mdf/ldf pair which is detached from the server after its created.Thank you...

how to implement user rating using ajax rating control from database?

Hi,I'm beginner to ajax. I've a database table having fields rating and item id.I've to display star rating using  ajax rating control for the corresponding item id.How can i do this?  

Best way to create a collection of User Control objects?

Hi, I'm completely new to WPF (this week) and still grasping C# and .net as a whole. I've created a User Control which I need to add (and be able to remove) multiple instances of into a vertical list. I've so far stuck this in a Listbox although I might change this later when I'm more comfortable. So when I add the object I've created as a ListBox item it displays fine, but my issue is I need to able to delete items and add items and have those items auto update etc - so I'm guessing the WPF way to do things is to build a collection and have it bind to the list box. My question is this, what is the best type of collection to hold such objects. I've tried an Observablecollection so that I can monitor changes but when I give it a.Itemsource = Observablecollection it just presents me with a list of <Collection>. Anyone any ideas?

User Data from database...can't fill ddl on PageLoad because of DataBound

I have a database where a user inputs data to multiple databound drop down listboxes.  That's saved to my aspnet database.  Then when the page loads again, I want to select the ddls items that the user selected as stored in the database to these databound ddls.  But it doesn't work, because on pageload, they haven't been databound yet.What's the best way to do this?  Do I need to run a SELECT statement for each and every ddl on it's databound event???

go back to Create User Step on CreateUserWizard control



I'm using a CreateUserWizard do add users to a web app. Everything is working great, but on thing... the Complete Step :-/

I don't need that extra step, and more, i'm using this control as an option where the administrator of the application adds his trusted users to the site. So, its part of a web form that has a list of users on one side and the CreateUserWizard on the other.

What i tried to do, and was unsuccessful, was to change the ActiveStepIndex back to 0 then the user creation was completed, but this didn't work. The Complete Step still appears. Also, i added this to the continue button event and it did nothing either: CreateUserWizard1.ActiveStepIndex = 0;

Is there any way i can "hide" this step? If not, is there a way to go back to the Create User Step when i click the Continue button in the Complete Step?


Need to create a customizable user control



I am planning to write a user control but need to know if anyone has ever read any good article on how to write a usercontrol. My requirement is to create a kind of panel control that can have option buttons, checkboxes and a gridview control. I already have created this control but everything is hardcoded (styles, other properties) in user control. I want to expose them to the user so that he can change the appearance and the placement of the controls by himself. Also, I want users to consume this control something like

<uc1: MyPanel runat="server">
  <panelgridview property1="" property2="" datasource="">...</panelgridview>
</uc1: MyPanel>

Not sure how to make the those sub tags for a usercontrol. Any pointers or help is much appreciated.

how create user control in asp.net


how create user control in asp.net 

Create user control fields based on bound properties



I am creating a user control that I would like to be able to generate the form entry fields based on what custom data object the form is bound to. Basically, I have a drop-down box that allows the user to pick what type of data object they are working with (user, address, etc.) That choice will bind the user control to the related data object. No big deal there. I am stuck, however, on how to generate the form fields based on the properties of the object. I feel like I have seen examples of this in WPF but am not able to find them now. All form fields will be simple label, textbox combinations in a stackpanel.

I know more detial will probably be required. Let me know what specifically you would like to know. Any help of direction is greatly appreciated.



create custom application page with a ribbon and user control webpart


i am in stress how to start this what should be the first step

i want to create custom application page with a ribbon and some user
control web part to show document item properties.

Please help me regarding this


thanks in advance 



wasikhan junior software ENG

MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

Choosing Between a User Control or Web Part for SharePoint

SharePoint will only display Web Parts on a page. However, there are publicly available shims that allow you to write user controls and have them be displayed as a Web Part. From SharePoint's point of view, the shim is a Web Part. From the point of view of the user control, the shim is simply a control in .NET that is including the user control

ASP.NET DropDownList Web Control, Part 1

Anybody with much experience in ASP has written an include file function for populating the contents of a SELECT dropdown list with entries from a database. Some of the more advanced users have even gone so far as to add caching to their function to reduce database hits for these rarely changing menu options. Naturally, these same techniques are going to be used with ASP.NET, but with a new programming object model. ASP.NET provides a web control, the DropDownList, which can be used for the same purposes as our custom built SELECT tag from Classic ASP.
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