|
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
|
|
|
|
|
Try using System.Uri. It's properties break up a url into segments which allow you to get any info you want out of the url w/o using string manipulation or writing your own regex.
|
|
|
|
|
thank you
but can i ask you what this line of code returns ??
Request.Url.GetLeftPart(UriPartial.Authority)
on my machine it returns http://localhost ,but what it will return
when i publish my application ??
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
From VS 2005 Documentation for System.Uri.GetLeftPart Method:
http://www.contoso.com/index.htm?date=today
returns "http://www.contoso.com"
http://www.contoso.com/index.htm#main
returns "http://www.contoso.com"
mailto:user@contoso.com?subject=uri
returns "mailto:user@contoso.com"
nntp://news.contoso.com/123456@contoso.com
returns "nntp://news.contoso.com"
news:123456@contoso.com
returns "news:123456@contoso.com"
file://server/filename.ext
returns "file://server"
|
|
|
|
|
Hi
i found this one
String URL ="http://www.codeproject.com/script/comments/forums.asp?forumid=1640";
HttpRequest req = new HttpRequest("", URL, "");
string str= req.Url.Authority;
<l>Thanks and Regards
Sandeep
|
|
|
|
|
thank you Mark J. Miller and Sandeep
that was very helpful
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
can anyone give example for session and application state
|
|
|
|
|
Hi
Which type of example you are asking for
Session["sandeep"] = "SomeValue";
Application["Akhare"] = "Throughout Application";
you can use this way
Session is used for perticular period(session only)after then it lost its value
where as application can retain the values even though session is lost i.e through out your application. Google it for more Info
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Hi, I created a master page with a contentplacementHolder, then I created a .aspx page that displays a google map. I want the div control that holds the map to be bound with the contentplacementHolder in the master page
Here's the link:
http://localhost:1157/KemetProjectRuntime/KemetProject.aspx
I don't know how can I do that, the code is so complicated.
|
|
|
|
|
hi
I am not getting Why have you given the link of your application From Internet it is not accesible by others ?
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Only Contents can be "bound" to ContentplaceHolders. Put one around your div, and that's it:
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="DependsOnMasterPage">
<div>
...
</div>
</asp:Content>
|
|
|
|
|
Nada Adel wrote: http://localhost:1157/KemetProjectRuntime/KemetProject.aspx
BWAAAHAHAHAHAAHA
|
|
|
|