You must Sign In to post a response.
  • Category: .NET

    Mr. Ramasamy.N thanks to u... but.........

    sir,

    onserverclick="getfilename" not worked.
    this form is post back ,but not go to "getfilename" function.

    any idia?


    sample function:


    Dim row As Integer = 0
    Dim numrows As Integer = 5
    Dim numcells As Integer = 5
    tabfile.CellPadding = "5"
    tabfile.Width = "100%"
    tabfile.Border = 1
    Dim j As Integer
    For j = 0 To numrows - 1
    Dim r As New HtmlTableRow()
    If row Mod 2 = 1 Then
    r.BgColor = "Gainsboro"
    End If
    row += 1
    Dim i As Integer
    For i = 0 To numcells - 1
    Dim c As New HtmlTableCell()
    'c.Controls.Add(New LiteralControl("row " & j.ToString() & _
    ' ", cell " & i.ToString()))
    'c.Controls.Add(New LiteralControl("<button onserverclick='Delete(" & i & ")' runat='server' type='button'>" & i + 1 & "</button>"))
    Dim NewButtonControl As New HtmlButton()
    NewButtonControl.ID = j & i + 1
    NewButtonControl.InnerHtml = j & i + 1

    c.Controls.Add(NewButtonControl)
    r.Cells.Add(c)


    AddHandler NewButtonControl.ServerClick, AddressOf Button_Click


    Next i
    tabfile.Rows.Add(r)
    Next j



    not work in NewButtonControl.ServerClick. is postback. but not went to function.


    i wrote page load this function: is worked clear ?
    Dim NewButtonControl As New HtmlButton()
    NewButtonControl.ID = "buttion"
    NewButtonControl.InnerHtml = "Click Me"
    AddHandler NewButtonControl.ServerClick, AddressOf Button_Click
    Controls.Add(NewButtonControl)



    Sub Button_Click(ByVal sender As Object, ByVal e As EventArgs)
    Dim k As String = sender.ToString()
    ' Display a simple message.
    LstFile.Items.Add("Thank you for clicking the button.")
    End Sub


    how is i handle?

    please help me.
  • #213930
    if(!ispostback))
    {
    Dim NewButtonControl As New HtmlButton()
    NewButtonControl.ID = "buttion"
    NewButtonControl.InnerHtml = "Click Me"
    AddHandler NewButtonControl.ServerClick, AddressOf Button_Click
    Controls.Add(NewButtonControl)
    }


    try this using post back. n let me have the feed back..

    Regards,
    Pavan Ravi Kumar.

    "Complex problems have simple, easy to understand wrong answers."

  • #213931
    i want seperate buttion in html table each row in one column.

    this function is single butiton.

  • #213932
    i want seperate buttion in html table each row in one column.

    this function is single butiton.

  • #213933
    priya just write the code what u have written in pageload

    in pageload

    if(!ispostback)
    'Write ur code here
    end if

    Regards,
    Pavan Ravi Kumar.

    "Complex problems have simple, easy to understand wrong answers."

  • #213934
    i dont want page loage create butiton. i want grid row click - display table in database column with row formate.




    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    _Utility.setStyle(Styler, link)
    If Not IsPostBack Then
    RefreshG()
    'Dim NewButtonControl As New HtmlButton()
    'NewButtonControl.ID = "buttion"
    'NewButtonControl.InnerHtml = "Click Me"
    'AddHandler NewButtonControl.ServerClick, AddressOf Button_Click
    'Controls.Add(NewButtonControl)
    End If
    _Utility.setGridStyle(Grid1)
    End Sub




    Protected Sub Grid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Grid1.SelectedIndexChanged
    eID.Value = Grid1.DataKeys(Grid1.SelectedIndex).Item(0).ToString
    RefreshGridView1()
    End Sub



    Private Function RefreshGridView()
    Dim ds As DataSet = getCurrentTasklevel(eID.Value)
    Dim str As String = ""
    Dim BtnFile As New Button
    Dim strLevelHeader As String = _fs.getLevelHeader()
    Dim lCount As Integer = _Utility.sqlScalar("select count(level_id) from m_level")
    str += "<table style=""width:100%"" cellpadding=5 cellspacing=0 id=table1>"
    str += "<tr class=bRowstyle>"
    str += "<th rowspan=2 >S.No</th>"
    str += "<th rowspan=2 >Task File ID</th>"
    str += "<th rowspan=2 >Part No</th>"
    str += "<th rowspan=2 >Start Time</th>"
    str += "<th rowspan=2 >End Time</th>"
    'str += "<th rowspan=2 >Alloted Level</th>"
    str += "<th colspan=" & lCount & " >Status</th>"
    str += "<th rowspan=2 >Status</th>"
    ' str += "<th rowspan=2 >Link</th>"
    str += "</tr>"

    str += "<tr class=bRowstyle>"
    str += strLevelHeader
    str += "</tr>"

    If ds.Tables(0).Rows.Count = 0 Then
    str += "<tr><td style=""text-align:center"" colspan=50>"
    str += "No files available for work"
    str += "</td></tr>"
    End If
    Dim i As Integer
    For i = 0 To ds.Tables(0).Rows.Count - 1
    Dim _tstatus As New TaskStatus(ds.Tables(0).Rows(i).Item("task_file_id"), ds.Tables(0).Rows(i).Item("level_id"), "border")
    Dim strStatus As String = _tstatus.HtmlString
    str += "<tr class=border>"
    str += "<td class=border><input type=""submit"" id=" & (i + 1).ToString & " OnServerClick=""getfilename()?task_file_id=" & ds.Tables(0).Rows(i).Item("task_file_id") & "&level_id=" & ds.Tables(0).Rows(i).Item("level_id") & " id=""btnfile"" runat=""server"" value= " & (i + 1).ToString & " > </td>"

    str += "<td class=border> " & ds.Tables(0).Rows(i).Item("task_file_id") & "</td>"
    str += "<td class=border>" & ds.Tables(0).Rows(i).Item("part_no") & "</td>"
    str += "<td class=border>" + ds.Tables(0).Rows(i).Item("start_time") + "</td>"
    str += "<td class=border>" + ds.Tables(0).Rows(i).Item("end_time") + "</td>"
    str += strStatus
    str += "<td class=border>" & ds.Tables(0).Rows(i).Item("completed") & "</td>"
    str += "</tr>"
    Next
    str += "</table>"
    divTable.InnerHtml = str
    For Each Con As Control In divTable.Controls

    Dim k As Control = Con
    Next
    End Function


    ok.
    but this RefreshGridView().

    divTable table is <div>.

    <div align="center" id="divTable" runat="server">

    tabfile is : <table>
    <table visible=true id="tabfile" runat="server" ></table>

    diplay table is string value in divTable.InnerHtml


    sorry my language. r u understand my proble.


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.