i use UpdatePanel. It work perfectly.
ma tju
Software Application Engineer Petaling Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Petaling Jaya MOP (Otai)
i use UpdatePanel. It work perfectly.
ma tju
Software Application Engineer Petaling Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Petaling Jaya MOP (Otai)
Actually I try to do this:
<%
For j = 0 To countCol - 1
'during loop it will skip this line. This is why I use response.write.
<td width=<%#(colSize(j))%>><%#Eval(colName(j))%></td>
Next
%>
but when it loops it will skip the code in the for loop. When i use response.write it will run line in for loop but return this error: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control. Hope this help. Thanks in advanced.
ma tju
Software Application Engineer Petaling Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Petaling Jaya MOP (Otai)
Sure, here is the code.
Dim conn As New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings(0).ConnectionString)
Dim sqlDA As New SqlDataAdapter("SELECT id, filename, img\_size FROM image ORDER BY id", conn)
Dim ds As New DataSet
Dim pgDataSrc As New PagedDataSource
Try
sqlDA.Fill(ds, "tl")
pgDataSrc.DataSource = ds.Tables("tl").DefaultView
pgDataSrc.AllowPaging = True
pgDataSrc.PageSize = 20
pgDataSrc.CurrentPageIndex = CurrentPage
'rptInbox is a repeater control
rptInbox.DataSource = pgDataSrc
rptInbox.DataBind()
Catch ex As Exception
Return False
Finally
conn = Nothing
sqlDA = Nothing
ds = Nothing
End Try
Well sometimes user want to see just 1 or more column in the repeater. Thats why i use for loop to generate the column. Hope this help. Thanks in advance.
ma tju
Software Application Engineer Petaling Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Petaling Jaya MOP (Otai)
Hi, Actually i need to use Eval to bind the data from datasource. But to use eval I need to include the '#' sign.
ma tju
Software Application Engineer Petaling Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Petaling Jaya MOP (Otai)
Hi guys, I got little problem here. I cannot get the value for ColName. Below are my code
<tr ondblclick="job_detail('<%#Eval("id")%>');" >
<td width="15"><input name="Checkbox51" type="checkbox" style=" width:13px; height:13px;" value="<%#Eval("id")%>" /></td>
<%
For j = 0 To countCol - 1
Response.Write("<td width=" & colSize(j) & ">" & Eval(colName(j)) & "</td>")
Next
%>
</tr>
It give me an error : Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control. Can someone help me. Thanks in advance. matju
ma tju
Software Application Engineer Petaling Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Petaling Jaya MOP (Otai)
Hi Shameel, Thanks for your reply to my problem. :-D Like Mycroft Holmes said, I just want a simply to move the 0 value records to the end of the sort. Regards.
ma tju
Software Application Engineer Petaling Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Petaling Jaya MOP (Otai)
Thanks a lot its working. +5 :-D
ma tju
Software Application Engineer Petaling Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Petaling Jaya MOP (Otai)
Hi, I have a table where the results are sorted using an "priority" column, eg:
aaa 0
xxx 1
bbb 3
ccc 0
aaa 2
I need the SQL results to be in a specific order based on the "priority", but not in ascending or descending order. The order that I want them in is 1,2,3,0,0,0,0.... Highest priority start with 1 to infinite (9999) number but the lowest priority is 0... Any suggestion guys? :)
ma tju
Software Application Engineer Petaling Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Petaling Jaya MOP (Otai)
Thanks navaneeth for your suggestion. I already find another way to solve my problem. Actually its hard for me to understand the article from msdn microsoft. :rolleyes:
ma tju
Pengaturcara Perisian Subang Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Subang Jaya MOP (Otai)
Thanks sheha. I have already settle my problem. I insert this code in gridview_RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Or e.Row.RowType = DataControlRowType.Separator Then
Dim Idstr As String
Idstr = CType(e.Row.FindControl("lblId"), Label).Text
If Idstr = 1 Then
CType(e.Row.FindControl("lblId"), Label).Text = "Yes"
If Idstr = 2 Then
CType(e.Row.FindControl("lblId"), Label).Text = "No"
End If
End If
ma tju
Pengaturcara Perisian Subang Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Subang Jaya MOP (Otai)
Hi, Where should i run the for loop. what should i read and replace. Thanks as an advanced
ma tju
Pengaturcara Perisian Subang Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Subang Jaya MOP (Otai)
Hello I have a field in my database with three options (unknown, yes, no) and the database stores numbers (1,2,3) I want to replace 1,2,3 with the corresponding unknown, yes or no in a bound datagrid. Any hints? Is it possible?
ma tju
Pengaturcara Perisian Subang Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Subang Jaya MOP (Otai)
Hi I am trying to use Message Box on click of a button which is inside update panel, but I am not getting the alert message while I am trigger - postback on click of that button(I have tried async postback also i.e. not working also). I want to know, will it work inside update panel or not. Please guide me if I am wrong. Thanks.
matju
Pengaturcara Perisian Subang Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Subang Jaya MOP (Otai)
tl;dr
ma tju
Pengaturcara Perisian Subang Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Subang Jaya MOP (Otai)
What is your solution?
ma tju
Pengaturcara Perisian Subang Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Subang Jaya MOP (Otai)
Dear all, I have a simple program that user can insert unicode or ascii text in a textbox. How to tell it is a Unicode or ascii? Is there any function in .Net? Thanks. :)
ma tju
Pengaturcara Perisian Subang Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Subang Jaya MOP (Otai)
Try googling 'precompile'
ma tju
Pengaturcara Perisian Subang Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Subang Jaya MOP (Otai)
Just start eating my breakfast...Still early in the morning here...
ma tju
Pengaturcara Perisian Subang Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Subang Jaya MOP (Otai)
bwahaha ;P
ma tju
Pengaturcara Perisian Subang Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Subang Jaya MOP (Otai)