• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 434
  • Last Modified:

asp.net placeholder

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 asp.net/ c# in one Void

500 pts for completed working codes.
1 Solution
Swadhin RaySenior Technical Engineer Commented:
if textbox =1?xxx : yyy ..here xxx is result if condition and yyy is else condition
Obadiah ChristopherCommented:
Can u explain what u want to achieve in UI. Ur question isn't very clear. 2ndly stop writing the 500 points for....thing
Webboy2008Author Commented:
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
so, you're dynamically creating and populating controls with contents based upon the control type?
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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now