|
hey
now the program is compiling.. but again 1 problem.
when the grid is displayed the "Dt" column shows the whole HTML tag, instead of the date.
i am using VISUAL WEB DEVELOPER EXPRESS 2005.. is is a problem of obsolete tag.
Kunal Piyush
|
|
|
|
|
I am guessing there is an unbalanced quote or something. Include the code and I will see if I can see anything wrong with it.
Ben
|
|
|
|
|
i am including the code..
though there shud have been an error regardin an unbalanced tag..
but still
<asp:TemplateField HeaderText="Dt" SortExpression="Dt">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Dt") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%Convert.ToDateTime(DataBinder.Eval(Gridview1.DataItem,"Dt")).ToString("dd/MMM/yyyy"))%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
Kunal Piyush
|
|
|
|
|
Your code:
Text='<%Convert.ToDateTime(DataBinder.Eval(Gridview1.DataItem,"Dt")).ToString("dd/MMM/yyyy"))%>'
Needs to be:
Text='<%# Convert.ToDateTime(DataBinder.Eval(Gridview1.DataItem,"Dt")).ToString("dd/MMM/yyyy"))%>'
That should do it.
Ben
|
|
|
|
|
hey ben
thanks a lot.. problem solved.. thanks again..
Kunal Piyush
|
|
|
|
|
Sorry it took so long.
Ben
|
|
|
|
|
hey.. i need to be sorry... didnt take in consideration about the brackets..
also.. why did we use "container" keyword.. we were using a gridview..
Kunal Piyush
|
|
|
|
|
In this case the Container is referring to the Dataset or dataTable or dataview that is bound to the gridview. When you use DataBinder.Eval you always have to use container.dataitem and then pass in the field you are looking for. The Bind method does the same thing it is just behind the scenes.
Ben
|
|
|
|
|
Hi,
I am an application in ASP.net 2.0with c#.
I would like to use FileUpload web control with Atlas In my application. If I remove the atlas property from my application then FileUpload Web Control is working well. But using Atlas property FileUpload is not working.
Is there any way to use FileUpload Web Control along with Atlas in my application?
Any help is appreciated.
Regards
Rajesh
rajesh
|
|
|
|
|
It doesn't work because the form type must be sent as multipart/www-encoded (I forget the exact string but its something with "multipart" in it). The Atlast async request is sent as a normal POST with just form field values. Google it or search on the ASP.NET AJAX forums, you won't be the first with this problem.
|
|
|
|
|
|
I have the following code in my application...
Protected Sub gridTerms_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gridTerms.RowDataBound
Dim strMsg As String
If (e.Row.RowType = DataControlRowType.DataRow) Then
If (e.Row.FindControl("lnkDelete") IsNot Nothing) Then
strMsg = "return confirm('Please confirm. Delete payment term " & Trim(e.Row.Cells(2).Text) & "?');"
CType(e.Row.FindControl("lnkDelete"), LinkButton).OnClientClick = strMsg
End If
End If
End Sub
For some reason the contents of this cell (which is a code) appears blank in the debugger and the JavaScript confirm shows an empty string in the message. The GridView appears fine but even investigating the value of e.Row.Cells(2).Text in the debugger reveals an empty string. Any ideas??
|
|
|
|
|
In my experience with this stuff, sometimes you get literal controls inbetween your actual controls in the cell. I am guessing that your text might be in cells(3) instead of cells(2). Just a stab in the dark.
Hope that helps.
Ben
|
|
|
|
|
Thanks for the reply. Actually, I investigated cells (0) through (4) in the debugger. All show empty strings, yet the GridView is populated with the propery data. This seems like it should be a no-brainer so it's really puzzling.
|
|
|
|
|
You know when I have added confirm javascript type stuff to delete buttons, I have used a For Each loop in the gridview databound event. That way I can go through each datarow find the control and add the javascript. That sort of seems like what you are trying to do.
Hope that helps.
Ben
|
|
|
|
|
Is this formatted text? I always had trouble getting the value from the cells that contained formatted text, maybe you should try to get the innerHTML.
Cleako
|
|
|
|
|
Hai,
what the method you are doing is correct.
the same logic is to be used after the data binding of grid and not in the databound or row databound event. this way...
<br />
foreach (DataGridItem dgi in dg.Items)<br />
{<br />
}<br />
really it works.
Cheers
asithangae
|
|
|
|
|
If it is working why would he be posting a question?
Cleako
|
|
|
|
|
He use this logic in rowdatabound event, i asked him to do the same after databind. i think you can know the difference.
Cheers
asithangae
|
|
|
|
|
please tell me how could i do internally postback by iframe in asp.net.
plzz help me with sample code.
tbhattacharjee
|
|
|
|
|
Internal postback means ?
Sorry i didn't understand your question please can you elaborate it ?
<l>Thanks and Regards
Sandeep
|
|
|
|
|
We have sql server with the name production1 (IPID:100.102.33.33) ,from asp.net iam able to connect properly ,yesterday we changed the ip Id of this system(production1) from that time if iam trying to connect from asp.net code it is giving error sqlserver does not exists access denied.
Iam able to connect in query analyzer for the same sql server by using same userid,password.
Iam able to connect in vb.net for the same sql server with same connection string which iam using in asp.net
Iam unable to connect in asp.net error sqlserver does not exists access denied.
Please help me is there any problem with asp user or what?
Thanks
|
|
|
|
|
Hai,
add the user ASPNET to the database you are using.
select the user from the list not by typing...
the user must be in the list of local users list or add the production webserver aspnet user to the database, if iis and database are in different machine.
this will work..
lot of links is available in google, try the appropriate one for you,
cheers
asithangae
|
|
|
|
|
Hello friends...I use 2 datalists say dtlist1 and dtlist2 and two pagers say pager1 and pager2 for each of them resp..and onpageload dtlist2 is displayed by default. When user clicks on a button dtlist1 is displayed...and after clicking on the pager for that datalist1 ..It shows second datalist i.e. dtlist2 ....becoz on page load dtlist2 is to displayed..To avoid such confict in pager..i decide to use datagrid which has its own pager..Then the problem occurs to show datagrid horizontally...Do anyone have any solution.....
|
|
|
|
|
Hi CP
Suppose that I have a url in s string, how can I get the site name i.e
Dim strURL as string = http://www.codeproject.com/script/comments/forums.asp?forumid=1640 "".
Then how can I extract the string " www.codeproject.com ", for sure we can do it with string manipulation, but is there another way ??
thank you all
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|