|
Read my reply, his code won't really work. You need a recursive function, and you definately do not need to do all that ugly casting.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Wow.
You're on the right track, and yet so far from it. The base class, Control, has the enabled property. The casting you're doing is totally superfluous, and makes the code messy.
Also, don't use 'is' and then cast. Use 'as' and use the result.
finally, the method needs to be recursive for it to work across the page.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Something Like this...
Private Sub DisableControls(ByVal c As Control)
If TypeOf c Is WebControl Then
CType(c, WebControl).Enabled = False
End If
For Each child As Control In c.Controls
DisableControls(child)
Next
End Sub
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
Thanks Christian Graus
i agree with you.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
Hello Mr. Christian Graus,
Thanks for kind help. Can u plz give me code for the recursive function?
Keep Smiling..........
|
|
|
|
|
Put all the controls inside a container control(panel) and pass the Container Control as a parameter to this function. This will Disable all the server controls that is inside the Container Control.
Private Sub DisableControls(ByVal c As Control, ByVal status As Boolean)
For Each child As Control In c.Controls
If TypeOf c Is WebControl Then
CType(c, WebControl).Enabled = status
End If
Next
End Sub
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
While I'm Creating an Object to a class using javascript in asp.net..Im getting this error..
Automation server can't create object
I' using this is my statement
var obj =new ActivexObject("Sample.clsSample")
|
|
|
|
|
What on earth is your problem ? You've asked this four times now, and you have got more than four answers. If you're incapable of understanding the answers, reply to the people who have answered you. What you're doing is plain rude. The answers will not change, no matter how often you ask.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi friend
soposed that i have tree node
root
parent1
child
parent2
child
i want if any body want to add child in child node then its not possible. or i want to restrict add any new node in child node how it's possible. please help me
Piyush Vardhan Singh
Senior Software Engineer
TAS NewDelhi
India
|
|
|
|
|
Tell me one thing paren1 and parent2 are predefine node or it create dynamically
When you add any node then check parent node of the node: if it is Root node then allow to add other deny.
Like:
Root
parent1
child1
parent2
suppose if user want to add node in child1 then check parent node of the child1 that is parent1 not it Root. so it will deny it.
if user want to add node in parent1 then check parent node of parent1 is Root that is Root so it will be allow.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
create dynamically
Piyush Vardhan Singh
Senior Software Engineer
TAS NewDelhi
India
|
|
|
|
|
When you add any node then check parent node of the node: if it is Root node then allow to add other deny.
Like:
Root
parent1
child1
parent2
suppose if user want to add node in child1 then check parent node of the child1 that is parent1 not it Root. so it will deny it.
if user want to add node in parent1 then check parent node of parent1 is Root that is Root so it will be allow.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
ok thanku i have done this
Piyush Vardhan Singh
Senior Software Engineer
TAS NewDelhi
India
|
|
|
|
|
I want to create an Object to a class which is in DLL using..
objSamp = new ActiveXObject("Sample.clsSample");
I'm using this statement in Javascript in ASPX page...
but I'm getting error in aspx page
error is "Automation Server Can't create Object"
How can I resolve this error..?
Please Help me.....
|
|
|
|
|
Hi
This is beacuse of windows can't verify the activex object which you have, once you make your activex control a signed component, the IE will install your component automatically, and you can fix this. i have got Lpktool.exe from google, that you can use to convert your activex object a signed component...(you must have the source code with you..!)
regards
Sebastian
|
|
|
|
|
Hi All,
I am having a datatable which has data as parent child relation. The problem I am facing is explain below with the example.
Ex:
ChildID Description ParentID
A Desc1 NULL
B Desc2 A
C Desc3 A
D Desc4 A
It shows
A
B --| Hidden under Parent A
C |
D ---
B Again Child Element is shown.
C
D
And I want the display as:
A
B --| Hidden under Parent A
C |
D ---
Please help me with this.
Thanks....
|
|
|
|
|
Not sure exactly, but I would say a Repeater will solve your problem, because it gives you the most control over your generated HTML. Nested repeaters may be required, I'm not sure, you've not explained it well enough for me to follow fully.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for the reply. Actually I am using javascript to build this tree and for building I am doing the following as I haveget data from Database:
DataTable dtFinal = cf.Return_DataTable("EXECUTE getAllData 719, 1, 0, 0", connectionString);
In dtFinal I get the records as
ChildID Description ParentID
A Desc1 NULL
B Desc2 A
C Desc3 A
D Desc4 A
And I need to show this as treegrid. Before this it was working fine as I was firing 2 different queries and get Parent and Child datatable and then fire query on Child datatable.
Things were fine till that time now when I execute sp and get only 1 datatable this are not working.
Hope I have explained my self well.
Please help me how to do this...
Thanks again....
|
|
|
|
|
OK, so the issue is in your code that iterates over the table. It makes more sense to me to generate two tables and create a relationship between them. If you're spitting it out in javascrpt, the most logical thing if you have a parent child relationship, is to spit out XML.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for the reply sir, actually all my logic is ready I just need to fire a proper query on datatable. Please help me as I dont want to change my hole logic.
Thanks again....
|
|
|
|
|
Well, if you won't change your middle tier, then I really don't know what to suggest. What form does the data take going to the browser ? Either the data is bad, or the script code is broken.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi everyone
while trying to add crystal reports to my project i came across the following error, could anyone help me out. Plzzzz Its urgent
m using
.net framework 1.0
IIs version 5.7
The error is as follows
Server Error in '/WebApplication3' Application.
--------------------------------------------------------------------------------
Access to the path "C:\Program Files\Microsoft Visual Studio .NET\Crystal Reports\Viewers" is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path "C:\Program Files\Microsoft Visual Studio .NET\Crystal Reports\Viewers" is denied.
The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.
To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in the Allow column.
Source Error:
Plzzz help me out.
hi
|
|
|
|
|
i need a tool that compares the text in two files and highlights the difference in that two files. its a urgent one. thasnq
Find and d/l a open source tool if possible.(Paid tools is also ok)
mallika
|
|
|
|
|
This has nothing to do with ASP.NET.
araxis merge is the best merger I have found, I bought it and am very happy with it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanx for the response
I need other than araxis and VSS
mallika
|
|
|
|