Click here to Skip to main content
15,902,635 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionCalling a serverside method by __doPostBack()? Pin
Tridip Bhattacharjee29-Jul-09 18:52
professionalTridip Bhattacharjee29-Jul-09 18:52 
AnswerRe: Calling a serverside method by __doPostBack()? Pin
Viral Upadhyay29-Jul-09 18:59
Viral Upadhyay29-Jul-09 18:59 
AnswerRe: Calling a serverside method by __doPostBack()? Pin
amitabha12331-Jul-09 0:41
amitabha12331-Jul-09 0:41 
QuestionProblem in adding a gif image Pin
janani1329-Jul-09 18:43
janani1329-Jul-09 18:43 
QuestionDynamically set iframe height and width Pin
syaiful_8629-Jul-09 17:29
syaiful_8629-Jul-09 17:29 
Questionselect a value from dropdownlist, textbox will populate corresponding to that value in dropdownlist Pin
haleemasher29-Jul-09 17:26
haleemasher29-Jul-09 17:26 
AnswerRe: select a value from dropdownlist, textbox will populate corresponding to that value in dropdownlist Pin
Blue_Boy29-Jul-09 20:45
Blue_Boy29-Jul-09 20:45 
Questiondisplaying controls [modified] Pin
soorma29-Jul-09 12:31
soorma29-Jul-09 12:31 
I have a datareader and i am passing many strings one by one to a sub. I think i have to do dynamically but how can i do it.


The data looks like this

datetimestart
datetimeend
String
String
cboStringM

i don't know the data in adv.. i am looping thru one by one. i don't know how many strings i will encounter. i can encounter 3 or 4 or 1 but i need to display the textbox for each string i pass and same goes for the listbox.

When i pass the datetimestart i show the calendar control.
When i pass the datetimeend i show another calendar control.
When i pass the String i show the textbox.
When i pass the second String i show another textbox.
when cboStringM then a listbox

But the second textbox is not showing. When the first string is passed the firsttextbox is set to true when when the second strings turn comes the firsttextbox is already true and it doesn't go to the second one.
That is my problem. How can i show both the textboxes when 2 strings are passed of the same name.

here is the code

Dim ParameterReportType As New Data.SqlClient.SqlParameter("@id", SqlDbType.VarChar, 50)
ParameterReportType.Value = Request.QueryString("id")
myCommandReportType.Parameters.Add(ParameterReport Type)

Dim objReaderparam As SqlDataReader = myCommandReportType.ExecuteReader()

Dim DisplayedName As New ArrayList
Dim ParameterType As New ArrayList
Dim ParameterName As New ArrayList
Dim DataSource As New ArrayList
Dim Hidden As New ArrayList
Dim DefaultValue As New ArrayList
Dim DatabaseSourceNumber As New ArrayList
While objReaderparam.Read()

DisplayedName.Add(objReaderparam.Item("DisplayedNa me"))
ParameterType.Add(objReaderparam.Item("Parameterty pe"))
ParameterName.Add(objReaderparam.Item("ParameterNa me"))
DataSource.Add(objReaderparam.Item("DataSource"))
Hidden.Add(objReaderparam.Item("Hidden"))
DefaultValue.Add(objReaderparam.Item("DefaultValue "))
DatabaseSourceNumber.Add(objReaderparam.Item("Data baseSourceNumber"))

formattable(objReaderparam.Item("DisplayedName"), (objReaderparam.Item("Parametertype")), (objReaderparam.Item("ParameterName")), (objReaderparam.Item("DataSource")), (objReaderparam.Item("Hidden")), (objReaderparam.Item("DefaultValue")), (objReaderparam.Item("DatabaseSourceNumber")))

End While
objReaderparam.Close()

Sub formattable(ByVal DisplayedName As String, ByVal Parametertype As String, ByVal ParameterName As String, ByVal DataSource As String, ByVal Hidden As String, ByVal DefaultValue As String, ByVal DatabaseSourceNumber As String)



If Parametertype = "datetimestart" Then
Calendar1.Visible = True
End If

If Parametertype = "datetimeend" Then
Calendar2.Visible = True
End If

If Parametertype = "date" Then
Calendar1.Visible = True
End If

If Parametertype = "cboStringM" Then
DataSource = Right(DataSource, Len(DataSource) - 1)
Response.Write(DataSource)

Dim MyDataAdapter As SqlClient.SqlDataAdapter
MyDataAdapter = New SqlClient.SqlDataAdapter(test, conntest)


Dim dataSet As DataSet = New DataSet
MyDataAdapter.Fill(dataSet)
Dim dt As DataTable = dataSet.Tables(0)
ListBox1.DataSource = dt


ListBox1.DataTextField = dt.Columns(0).ColumnName
ListBox1.DataValueField = dt.Columns(1).ColumnName
ListBox1.DataBind()
ListBox1.Visible=True
End If



If Parametertype = "String" Then
TextBox1.Visible = True
End If
end sub


<asp:Calendar ID="Calendar1" runat="server" Visible="False"></asp:Calendar><br /><br /><br />
<asp:Calendar ID="Calendar2" runat="server" Visible="False"></asp:Calendar>

<asp:ListBox ID="ListBox1" runat="server" Visible="False" SelectionMode="Multiple"
></asp:ListBox>



<asp:TextBox ID="TextBox1" runat="server" Visible="False"></asp:TextBox><br /><br />
<asp:TextBox ID="TextBox2" runat="server" Visible="False"></asp:TextBox><br /><br />

modified on Wednesday, July 29, 2009 6:53 PM

QuestionLink Button Event Handler Pin
Ersan Ercek29-Jul-09 11:05
Ersan Ercek29-Jul-09 11:05 
AnswerRe: Link Button Event Handler Pin
Christian Graus29-Jul-09 11:10
protectorChristian Graus29-Jul-09 11:10 
GeneralRe: Link Button Event Handler Pin
Ersan Ercek29-Jul-09 22:33
Ersan Ercek29-Jul-09 22:33 
QuestionPolymorphism Pin
BhavinBhatt29-Jul-09 8:04
BhavinBhatt29-Jul-09 8:04 
AnswerRe: Polymorphism Pin
Not Active29-Jul-09 9:50
mentorNot Active29-Jul-09 9:50 
GeneralRe: Polymorphism Pin
BhavinBhatt30-Jul-09 21:40
BhavinBhatt30-Jul-09 21:40 
GeneralRe: Polymorphism Pin
Not Active30-Jul-09 23:32
mentorNot Active30-Jul-09 23:32 
GeneralRe: Polymorphism Pin
BhavinBhatt31-Jul-09 21:11
BhavinBhatt31-Jul-09 21:11 
Question.net applications Pin
shankarbuddhi29-Jul-09 6:46
shankarbuddhi29-Jul-09 6:46 
AnswerRe: .net applications Pin
Abhijit Jana29-Jul-09 7:09
professionalAbhijit Jana29-Jul-09 7:09 
AnswerRe: .net applications Pin
Christian Graus29-Jul-09 11:11
protectorChristian Graus29-Jul-09 11:11 
Questionlittle problem!! Pin
zeeShan anSari29-Jul-09 5:03
zeeShan anSari29-Jul-09 5:03 
AnswerRe: little problem!! Pin
Abhijit Jana29-Jul-09 5:09
professionalAbhijit Jana29-Jul-09 5:09 
GeneralRe: little problem!! [modified] Pin
zeeShan anSari29-Jul-09 5:33
zeeShan anSari29-Jul-09 5:33 
AnswerRe: little problem!! Pin
zeeShan anSari29-Jul-09 5:53
zeeShan anSari29-Jul-09 5:53 
AnswerRe: little problem!! Pin
Christian Graus29-Jul-09 10:48
protectorChristian Graus29-Jul-09 10:48 
QuestionAdding ButtonColumn to GridView Dynamiclly Pin
reem_saeed29-Jul-09 4:22
reem_saeed29-Jul-09 4:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.