Click here to Skip to main content
16,004,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
shows nothing, I hope to show the number of the day

Please help me correct code
ASP.NET
Response.Write("<tr>")
For I = 1 To 31
    Response.Write("<td>")
          <asp:LinkButton id="LinkButton3"
            Text='<%#Eval("I")%>'
            CommandName = "Dia"
            commandargument = '<%#Eval("I")%>'
            OnCommand = "LinkButton_Command"
            Runat="server"/>
    Response.Write("</td>")
End If
Response.Write("<tr>")
Posted
Updated 29-Aug-12 8:05am
v4
Comments
Christian Amado 29-Aug-12 13:24pm    
This is not asp.net. What are you doing here?
fjdiewornncalwe 29-Aug-12 14:24pm    
Of course it is. Why would you say that?
Carlos j. Ramirez 29-Aug-12 17:24pm    
I want to do a monthly calendar
I tested with
I'm trying to <asp: Repeater

AUGUST 2012

D L M M J V S
1 2 3 4
5 6 7 8 9 ...
31

using <asp: LinkButton and open function

OnCommand = "LinkButton_Command"
Dasaradhi_r 30-Aug-12 7:28am    
Hi Carlos, Did you try using my solution?

1 solution

Hi Carlos, I understood that you are trying to create the controls dynamically from code and setting it text and command argument.
Although my answer is not straight to say why your code is failing, but I would rather prefer using the below code (in vb.net):
VB
For I As Integer = 0 To 30
    Dim lb As New LinkButton()
    lb.Text = I.ToString()
    lb.CommandName = "Dia"
    lb.CommandArgument = I.ToString()
    lb.Command += New CommandEventHandler(lb_Command)
    form1.Controls.Add(lb)
Next
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900