Solved placeholder

Posted on 2011-04-26
Last Modified: 2012-05-11
Front End
<asp:TextBox >
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
<asp:button Id="clickme">
Code Behind:
Public Void (x)
Run Database
If TextBox value = 1
Select maxPremium, MinPremium From  TableA where Id = x
 Return  <select>
Fill the data

Elseif TextBox value = 2
  Select Top 1 Maxpremium, MinPremium From TableA where id = x
   Return <input textbox></input> Fill the data

End If
Once code behind done, using Placeholder to show the UI.

Overall, how can I code it in c# in one Void

500 pts for completed working codes.
Question by:Webboy2008
    LVL 16

    Expert Comment

    by:Swadhin Ray
    if textbox =1?xxx : yyy xxx is result if condition and yyy is else condition
    LVL 20

    Expert Comment

    Can u explain what u want to achieve in UI. Ur question isn't very clear. 2ndly stop writing the 500 points for....thing

    Author Comment

    Once the textbox has value like 1, 2, or 3.
    It will go to db to search UIcolumn.
    If UIcolumn return 1 then show inputbox
    if Ulcolumn return 2 then show dropdown

    Inside of inputbox / dropdown value must be filled and value came from db. like MaxPremium, MinPremium
    LVL 7

    Expert Comment

    so, you're dynamically creating and populating controls with contents based upon the control type?
    LVL 7

    Accepted Solution

    sorry, you'll have to convert to C#, and probably call some methods to load up your controls with their queried values
    Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
            Select Case TextBox1.Text
                Case "1"
                    Dim newtextbox As New TextBox
                    newtextbox.Text = "here are my values"
                Case "2"
                    Dim newdropdown As New DropDownList
                    newdropdown.Items.Add("min value")
                    newdropdown.Items.Add("inbetween value")
                    newdropdown.Items.Add("max value")
                Case Else
                    'do nothing at all
            End Select
        End Sub

    Open in new window


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now