|
Hello Developer,
I need an urgent help.
I have a xml file that contains some Menu tag like this.
<?xml version="1.0" encoding="utf-8" ?>
<Menu>
<Group Flow="Horizontal">
<Item NavigateUrl="/Home.aspx" Width="53px" Height="22px" ImageUrl="/images/nav_home.gif" ImageOverUrl="/images/nav_home_over.gif" runat="server" >
</Item>
<Item NavigateUrl="/HRTools/EmployeeTools/EmployeeProfile.aspx?view=true" Width="135px"
Height="22px" BackColor="Transparent" ImageUrl="/images/nav_profile.gif" ImageOverUrl="/images/nav_profile_over.gif" runat="server">
<Group>
<Item NavigateUrl="/HRTools/EmployeeTools/EmployeeProfile.aspx?view=true" Text="Personal Information" runat="server" />
<Item NavigateUrl="/HRTools/EmployeeTools/PositionInformation.aspx?view=true" Text="Job Information" runat="server" />
<Item NavigateUrl="/SelfService/MyPay.aspx?view=true" Text="Compensation" runat="server" />
<Item NavigateUrl="/BenefitsAdmin/BenefitsSummary.aspx?view=true" Text="Benefits" runat="server" />
Now I want to read this file in my c# page with the following details.
I have different type of users some of them belongs to Manager label and some of them is Agency. Agency label user should not be able to see the menu that is for Manger label.Can somebody help me about this...
|
|
|
|
|
Its poor form to say you need urgent help. Also you don't specify the technology, other than c# page. Is it a webpage? Is it a Windows form? I assume the former.
Regardless though what you need is to construct the menu dynamically, from an xml file, or database, or where ever, based on the current users role. Or possibly have two Menu files that can be switched based on the user role.
only two letters away from being an asset
|
|
|
|
|
Hey Mark,
Thanks for your quick response.Yes it is a web page.
Actually I want to construct menu dynamically.My XML file contains those all the menus.But I want to display those menu based on users role.
The same I am also thinking but can you please give me some references code please it's really urgent and I am looking for your quick help.Your help is really appreciated..
Thanks
|
|
|
|
|
Actually I want two things
One: how to build hierarchical menu systems for web-based applications, and two: how to add security and auditing.
I am using ASP.net and C#.I have an XML file that contains all the menu items we just nned to add security and auditing..
|
|
|
|
|
have you looked at the ASP.NET menu control? Another possible way would be to use XSLT
only two letters away from being an asset
|
|
|
|
|
I tried with ASP.Net menu control I am able to display menu according to user but problem is that I have to use multiple xml files for this.Let say for manager I use manager.xml files and for Agency I used agency.xml file. But I want to use only one xml file.
Can you please give me some Idea about that..
Thanks,
|
|
|
|
|
I've used the search function to look for articles but didn't find what I needed.
I've been tasked with developing an application to run a simulation. The requirements are to allow one or more servers to run the simulation at the same time sharing the load. Are there any articles or books that can give me a headstart in designing this application?
Thanks!
- Darroll
Darroll
|
|
|
|
|
It depends on what you need help with. If you are looking for a way to efficiently split the workload, it will be hard to give you pointers without knowing the specific problem and how it can be easily divided into smaller tasks. If the problem is setting up the servers, how to connect to them, how to discover their current work loads, etc., then there is a lot of help to be had. Please be a bit more specific as to what kind of assistance you are looking for.
Jeff
|
|
|
|
|
My main concern at the moment is how to manage objects between instances of the servers. The simulation takes multiple vehicles buildings and people. all doing various tasks. There will also be resources that get consumed and created. My thougts were to devide the work load via regions. This way I can segment the load based on the number of objects in a region by resizing the regions. The design of the object menagment and also the best way to transfer and manage objects is what I am looking for.
Thanks!
-- modified at 15:03 Tuesday 20th November, 2007
Darroll
|
|
|
|
|
I would probably have both servers implement identical functionality, which is that either can be initially contacted with the full load. Then, that server delegates some work to the second machine. Use asynchronous web service calls with a delegate to return when the entire task is finished. The second machine can pass info back the same way (asynch calls). If security is an issue, encrypt and authenticate. Make sure that all your objects are serializable, and the easiest way to send would be via soap messages with the serialized object, or you can open a TcpConnection or SSL connection and get a stream from that. As far as object management goes, you will have to have two copies of each object: one on the client, and one on the server. If you find you don't need to keep an object, then pass it on a delete it. I feel like this isn't really helping at all, but I hope I am wrong and I have answered some of your questions.
Jeff
|
|
|
|
|
i hope someone can help me.
is it possible to resize OTHER windows through a C# program? i tried memory editing and that obviously didn't work.
lets assume i have the windows handle. what else would i need to do to resize the window?
(some code would be appreciated)
thanks
-tmpryid
|
|
|
|
|
SendMessage WM_RESIZE to the target window.
|
|
|
|
|
ok, this is what i have so far:
<br />
int hwnd;<br />
int WM_SIZE = 0x0005;<br />
[DllImport("User32.dll")]<br />
public static extern int FindWindow(string strClassName, string strWindowName);<br />
[DllImport("User32.dll")]<br />
public static extern Int32 SendMessage(int hWnd, int Msg, int wParam, int lParam);<br />
<br />
hwnd = FindWindow(null, "Untitled - Paint");<br />
SendMessage(hwnd, WM_SIZE, 0, 0);<br />
but how do i specidy teh width and height i want to resize to?
-tmpryid
|
|
|
|
|
Hmm, the wParam will probably point to a WINDOWPOS struct, which now that i look at it, is the same as the parameters for the SetWindowPos function I posted below.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
I think there is actually a function for this in user32 or something, one moment whilst i go find it.
Bah, of course SetWindowPos:
http://msdn2.microsoft.com/en-us/library/ms633545.aspx[^]
So, in c# that would be:
[DllImport("user32")]
static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
I've used it before but i can't seem to find the code with the flags and whatnot, so you may need to do a little searching.
Or you can indeed send a message, but then you'll still need to search for the values to send in the message.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
My mistake, I mentioned WM_RESIZE, that's not it. See this thread[^] for more info.
|
|
|
|
|
I need a problem in an application im writing:
In my app there is a class User
[serializable]
Class User
{
public string _name;
public int _id;
}
i create an instance of this class in memory.
I haev a file in my file system that the the xml represemnatation of this class has to be the header of the file
(without changing the original file)
how can i combine the xml user class and the file in the most correct and eficiant manner - combinig them in memory
to a stram or byte array.
How can i do taht in teh most correct and eficiant manner?
Sample code will be great
Thanks
|
|
|
|
|
I problem in an application im writing:
In my app there is a class User
[serializable]
Class User
{
public string _name;
public int _id;
}
i create an instance of this class in memory.
I haev a file in my file system that the the xml represemnatation of this class has to be the header of the file
(without changing the original file)
how can i combine the xml user class and the file in the most correct and eficiant manner - combinig them in memory
to a stram or byte array.
How can i do taht in teh most correct and eficiant manner?
Sample code will be great
Thanks
|
|
|
|
|
I am attempting to make a class that implements the IList<> interface, but I need to be able to check if the user declared my type using the "readonly" keyword, so I can disable methods like "Add", "Remove", "RemoveAt", etc. Is this done automatically for me, or do I have to do some special programming for it? Thanks,
Jeff
|
|
|
|
|
No, that's not what readonly is for, but you could follow the lead of System.Security.SecureString and add a MakeReadOnly method.
|
|
|
|
|
Then what is readonly for, and why is there an IsReadOnly property required by the IList<> interface?
Jeff
|
|
|
|
|
readonly means the field itself can be assigned once.
IsReadOnly is a property on a list class that simply states to consumers whether elements can be added to the list.
|
|
|
|
|
Oh. Oops, I guess I have to go back and modify all of the code where I thought that readonly was being used within the reference classes to denote locking the collection.
Jeff
|
|
|
|
|
Good thing you asked then.
|
|
|
|
|
Im writing a c# appliction that makes use of threading.timer. According to the msdn i can specify a period The time interval between invocations of callback
,
Does this means the timer will not t\ck until i finish handeling the tick event?
I tried it out and I got two threads in the callback method… how can I solve this?
Im using only one timer so there is no problem of more than one timer .
Sample code will be greate help
thanks
|
|
|
|