|
Hi,
check this , may be it help
Directory.GetFileSystemEntrie(*.txt)
|
|
|
|
|
I've written the following code to remove a node from a treeview on a postback. The node and underlying data are removed, by the node is still there. Apparently I need to force a refresh, as the selected node does go away when I navigate away and back to the page. I have a similar sub that expands or collapses the tree without any problems so this behavior doesn't seem consistent.
Can anyone help?
Thanks
Ron
106 Protected Sub Button_DeleteFeeds_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button_DeleteFeeds.Click
107 'Remove selected feeds from the RSS feed list
108 Dim node As TreeNode
109 Dim nodes As TreeNodeCollection = TreeView_PersonalFeeds.CheckedNodes
110 Dim promptText As StringBuilder
111
112 promptText = New StringBuilder("Delete the following feeds?")
113
114 If nodes.Count > 0 Then
115 For Each node In nodes
116 promptText.AppendLine()
117 promptText.Append(node.Text)
118 Next
119 Dim result As Integer = MsgBox(promptText.ToString, MsgBoxStyle.OkCancel, "Delete Action")
120 If result = MsgBoxResult.Ok Then
121 For Each node In nodes
122 DeleteNode(node)
123 Next
124 End If
125
126
127 End If
128
129 End Sub
130
131 Protected Sub DeleteNode(ByVal node As TreeNode)
132 If node.ChildNodes.Count = 0 AndAlso node.Text <> "" Then
133 'node is a leaf node (feed item)
134 personalFeedItemsAdapter.Delete(New System.Guid(node.Value))
135
136 Else
137 'node is a folder or feed node
138 If Not String.IsNullOrEmpty(node.Text) Then
139 'node must reference a feed (guid string has been stored in text field)
140 'remove the feed from the db
141 personalFeedsAdapter.Delete(New System.Guid(node.Value))
142 End If
143 For Each child As TreeNode In node.ChildNodes
144 'recursively remove child nodes
145 DeleteNode(child)
146 Next
147 End If
148 'remove the node from the tree
149 TreeView_PersonalFeeds.Nodes.Remove(node)
150 End Sub
-- modified at 18:44 Monday 24th July, 2006
|
|
|
|
|
neutronron wrote:
149 TreeView_PersonalFeeds.Nodes.Remove(node)
I think the problem is at this line, the Nodes collection of the TreeView control bascially contains the root nodes of the treeview. So if you want to remove the non-root node, you need to remove it from the ChildNodes collection of its parent node. From what I see in your code, you also do the delete command against DB, and when you go away and back to this page, you may have rebound data to the control. And as a result of that, the TreeView displays properly. If this is the case, you'll need remove the node in the TreeView in the right way, or another option is that you can simply rebind the updated data to the treeview control after you execute the delete commands on DB.
|
|
|
|
|
Hello
I had a problem. i AM using ASP.Net Data Grid . I ahve 6 coulmn .I have to show the image in first column as a hyperlink.
If any one have idea about it plz let me knw that how can i show image in the column of Data Grid.
Thanks
Ragds
Atif
|
|
|
|
|
<asp:DataGrid id="grid" runat="server">
<asp:TemplateColumn>
<a href="www.microsoft.com">
<asp:Image ImageUrl="bird.jpg" />
</a>
</asp:TemplateColumn>
</asp:DataGrid >
-- modified at 14:53 Monday 24th July, 2006
|
|
|
|
|
hey Atif
Look at this Link: http://www.extremeexperts.com/Net/Articles/AddingControlstoFooter.aspx
they are explaining to add things to the fotter, Ignore that
try to see how they are adding the text boxes within the <ItemTemplate>....</ItemTemplate> tags
the way they are adding the Textboxes in there u can use to add a <asp:Image or a <img instead from the HTML side
To do wat u want to do best do it from HTML.
also look up <%# DataBinder.Eval(Container.DataItem,"abc") %> to recive data from the DB
"abc" is the column name. of the table.
keep in mind this is not supported use of a DataGrid, this is comming in from teh classic Asp Days, and is not commonly used:
check it out!
Cybertrace
Cybertrace! Said so..
|
|
|
|
|
Cybertrace wrote: keep in mind this is not supported use of a DataGrid, this is comming in from teh classic Asp Days, and is not commonly used:
Really
only two letters away from being an asset
|
|
|
|
|
How is a control programmed to be validated on the browser instead of the server? Is this done by not using the "runat" attribute or is there something else that needs to be done? I would want a control to be validate on the browser to then posted to the browser if the date confirms to anticipated format.
Greg
Coding makes the world go round!!!
|
|
|
|
|
Use the EnableClientScript property of you validator. In the case of CustomValidator you also supply the client function in the ClientValidationFunction property
only two letters away from being an asset
|
|
|
|
|
Hey everybody!
I'm writing automation using the webbrowser controller. I already wrote this kind of automation in c# 2003, but this time I'm encountering a silly problem that I just can't find an answer to.
I'm getting a button as an HtmlElement from the HtmlDocument using the button's ID, and all I want is to click that button. for some reason I don't find any way to push the button!
can anyone help me with silly problem ???
THANKS!
|
|
|
|
|
Any reason why you can't just call Button_clicked(null, null)? (Or on the client side, docuemnt.getElementById('Button').click();)
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
???
sorry for the ignorance.
lets say I want an automation that searches google.
and I want to click the "google search" button.
so, let element be a and HtmlElement with the button, and... how do I click it?!
I don't have element.click(), or document.getElementById("button").click().
I guess what I just don't understand is "Button_clicked(null, null)", thing.
what would a Button_clicked(null, null) method can do ?! (besides doing nothing...., and it won't make the browser actualy click the button).
I'm confused!
help? (again, sorry for the ignorance).
|
|
|
|
|
Right - -think I get what you're saying....
In order to programmatically click a button on the client side, you need to know the button's ID...
You can do this by either View Source, or using the IE Dev toolbar.
Once you know its ID, you can get hold of it as an object using document.getElementById(buttonID) (in Javascript)
Then just call .click() method of the button.
The (null, null) bit is a server side thing - I was assuming that you had access to the codebehind, in which case, you can call the handler directly. But since you're using the webbrowser control (just out of interest-WHY?) it won't work..
BTW - what do you mean about "I don't have....."?
Am I following what you want to achieve?
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Why would it make sense to use the session or application cache when you can use the asp.net cache for the same purpose.
I.E. when you store info that is user specific just use a user id as part of the key name.
I just don't see how the session or application cache provide anything other than a mental compartment or semi convenience for what is in effect the same thing in the end and could be simplified by just using one cache "location".
|
|
|
|
|
I guess one reason is that Cache is application based while session is of course session based.
only two letters away from being an asset
|
|
|
|
|
Hmmm...so after posting here, reading many books and scouring the web it appears that there is really no need at all for the other forms of caching. Maybe they are there for historical reasons.
Thanks for replying.
|
|
|
|
|
Well session variables get destroyed when the session ends whereas you would have to manually clean up all the relevent application variables when a session ends.
|
|
|
|
|
Yeah true, that's a point for sure.
|
|
|
|
|
I could not find the category of crystal reports forum so I am posting here. Sorry for that.
I want to declare global variable in formula editor and access that variable in another formula editor in the same report. How can I do that? Please help.
|
|
|
|
|
|
Ok - I have a parent window where a table is - once the user clicks inside a cell - I want a popup to appear - which it does using this code:
Dim sUrl As String = "Popup.aspx"
Dim sFeatures As String = "'height=200;width=200px;left=75;top=100;menubar=no;resizable=yes;scrollbars=no;status=no;titlebar=no;toolbar=no'"
'create a client script to open the window
im sScript As String
sScript &= ""
Script &= "window.open('" & sUrl & "',''," & sFeatures & ");"
sScript &= ""
'write it into the outpit stream for immediate execution and open the popup
Response.Write(sScript)
Using the popup window I save all the selections made into my database - once I do this I want the window to cause the parent to postback - which I do with this code:
Dim sScript As String
sScript &= ""
sScript &= "opener.location.reload();"
sScript &= ""
'write it into the outpit stream for immediate execution and open the popup
Response.Write(sScript)
Now after this is all complete - I want the popup.aspx window to close - I tried this:
'once everything is posted back to the parent window - close the popup
sScript &= ""
sScript &= "self.close()"
sScript &= ""
Response.Write(sScript)
BUT the window remains open - I am totally stumped as to why it will not close. Also can you make it vbmodal somehow until it closes or somethign otherwise it just lies behind the parent window.
Thx, T
|
|
|
|
|
well I guess self.close() is the same as window.close()
But, also how will your opup know its closed?
Are you keep a reference in the parent window and after reload notifying all children to close? That would solve your delimna because nothing is telling the child to close.
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
I am trying to load an Unmanaged win32 dll file in my web application. I have tried
both DLLImport() and LoadLibrary() methods. While in the later one, I have loaded the Kernel32.dll file first and then tried to load my specified dll file using LoadLobrary method. I have checked my dll file by moving it to all locations, like bin, root and the folder in which aspx forms are lying. Its becoming a headache for me now.
I have even checked out the privelege for executing unmanaged code for my application, its there.
Sayed Muhammad Imran
|
|
|
|
|
the folder its created in is c:\windiws\Microsoft...
If you create a wrapper it will be included
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
I have developed a simple application to do emails to different users. But one thing i cannot understand. After my application sends email, this email is placed in Queue folder but i cannot recieve that email
One more thing i want to know that wt are the available free smtp server by using which my application can send email to all the internet users.
Good Luck
|
|
|
|