[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • 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
<option></option><option></option>
</select>

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.
.
0
Webboy2008
Asked:
Webboy2008
1 Solution
 
Swadhin RaySenior Technical Engineer Commented:
if textbox =1?xxx : yyy ..here xxx is result if condition and yyy is else condition
0
 
informaniacCommented:
Can u explain what u want to achieve in UI. Ur question isn't very clear. 2ndly stop writing the 500 points for....thing
0
 
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
0
 
mr_nadgerCommented:
so, you're dynamically creating and populating controls with contents based upon the control type?
0
 
mr_nadgerCommented:
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"
                Panel1.Controls.Add(newtextbox)
                'GridView1.Rows(0).Cells(1).Controls.Add(newtextbox)
            Case "2"
                Dim newdropdown As New DropDownList
                newdropdown.Items.Add("min value")
                newdropdown.Items.Add("inbetween value")
                newdropdown.Items.Add("max value")
                Panel1.Controls.Add(newdropdown)
                'GridView1.Rows(0).Cells(1).Controls.Add(newdropdown)
            Case Else
                'do nothing at all
        End Select
    End Sub

Open in new window

0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

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