|
I try to add this control to my project, but I can't. I clicked to add Existing Item... and added controls.aspx but I get "Error creating control" error name is "Object reference not set to an instance of an object". For that reason how can I add this control top of my project,please help me
|
|
|
|
|
I think,if Venkat Eswaran can give me controls.aspx.cs file I can solve this problem
|
|
|
|
|
When I click on main links on tab control, the sub links dont change.
|
|
|
|
|
How can I change link target in the XML . I wanna open link in a frame . How can I do. Please help me.
|
|
|
|
|
Hi
Take a look at my post on March 1st and the replies. Hopefully this should answer your question.
Cheers
Richard
|
|
|
|
|
I have problem with this error. my aspx file include this.
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="ComboDeneme.WebForm1" %>
<%@ Register TagPrefix="CONTROL" Namespace="Controls" Assembly="FOURINONE"%>
<title>WebForm1
<control:fourinone runat="server" display="H" controltype="menu" id="Fourinone" name="Fourinone">
I wrote to cs file same thing with example. and configrate my web.config but I took this error. How can I do? Somabody help me.
|
|
|
|
|
<control:fourinone runat="server" display="H" controltype="menu" id="Fourinone" name="Fourinone">
sorry. I wrote this too in the aspx file.
Must I define FOURINONE object in cs file?
|
|
|
|
|
I didnt see my sentence in the question. for that reason I writing again
<div style="Z-INDEX: 101; LEFT: 5px; POSITION: absolute; TOP: 33px">
<CONTROL:FourinOne runat="server" Display="H" Controltype="menu" ID="Fourinone" NAME="Fourinone" />
</div>
|
|
|
|
|
Hi Venky
I have the menu control working ok over frames with the change you suggested. I also had to change the code elsewhere so it you click the top level menu it also goes to the correct target and not to '_self'.
However if I use a horizontal menu in a narrow frame at the top of the page and there is not sufficient space to show all the options on a sub menu it centres itself vertically and the bottom options are cut off as they only render within that frame.
I am wondering if it possible to change something so
1. The submenu renders over the top of other frame so a long submenu is possible .
2. The submenu does not centre itself and always hangs below the top level label.
Thanks
Richard
|
|
|
|
|
Help!!!
I'm trying to modify this code to allow for forms to reside in subdirectories. It appears to be forcing all forms to reside in the root of the webpage.
I can see in the "Render" method where it's passing the "BaseURL" to the "stm_ai" java routine, but that's where it get lost .
My page is localhost/home/About/Overview.aspx. If I set my "BaseURL" in the Data.XML file for this mainmenu to "default.aspx", the URL that is generated from the menu click is:
localhost/home/About/default.aspx
and what I want is
localhost/home/default.aspx
I've tried modifying the Data.xml "BaseUrl" to "/home/default.aspx", but that returns that appended to the current directory.
Does anyone know what I need to change to remove this local directory form the URL so that I can qualify my pages in the Data.xml file?
Thanks for your help.
Rich
|
|
|
|
|
Hi Rich
I am not sure why you have a problem. I have pages in sub-folders working just by specifying "subfolder/page.aspx" in the BaseURL and URL attributes.
Cheers
Richard
|
|
|
|
|
Hi
I have a few questions.
1. What does the CongSpecific attribute of a SubMenu entry do?
2. Does the control support frames? If a put a horizontal menu in a left side frame, I want to control the contents of the right frame. I thought maybe the URLTarget attribute of SubMenu entry may allow you to specify the target frame but it did not work with my test.
3. What then is the URLTarget used for?
Thanks for the great control.
Cheers
Richard
|
|
|
|
|
I actaully meant to say vertical menu, but I guess you get the idea!
|
|
|
|
|
Hi Richard,
The CongSpecific is no where connected to this control. I have used that for my project for internal opertaions. Please dont get confused with that.
strRender.Append("stm_aix(\"p1i0\",\"p0i0\",[0,'"+mySubDataView[j]["Label"].ToString()+"',\"\",\"\",-1,-1,0,\""+mySubDataView[j]["URL"].ToString()+"\",\"_self\",'"+mySubDataView[j]["URL"].ToString()+"',\"\",\"\",\"\",0,0,0,\"\",\"\",0,0,0,0,1,\""+SubmenuBgColor+"\",0,\""+SubmenuMouseoverColor+"\",0,\"\",\"\",3,3,0,0,\"\",\"\",\""+SubmenuFontColor+"\",\""+SubmenuMouseOverFontColor+"\"]);");
first URL is for Link and second URL is for appearing on tne status bar during mouse over. You can chage the Second url by ur module name or anything
Here we have used _self as target, you can can change to anything like _parent,etc..
Venky
|
|
|
|
|
Hi Venky
Thanks for your quick reply.
I adjusted your code to
strRender.Append("stm_aix(\"p1i0\",\"p0i0\",[0,'" +
mySubDataView[j]["Label"].ToString() + "',\"\",\"\",-1,-1,0,\"" +
mySubDataView[j]["URL"].ToString() + "\"," +
"\"" + mySubDataView[j]["URLTarget"].ToString() + "\",'" +
mySubDataView[j]["URL"].ToString() +
"',\"\",\"\",\"\",0,0,0,\"\",\"\",0,0,0,0,1,\"" +
SubmenuBgColor + "\",0,\"" + SubmenuMouseoverColor +
"\",0,\"\",\"\",3,3,0,0,\"\",\"\",\"" + SubmenuFontColor +
"\",\"" + SubmenuMouseOverFontColor + "\"]);");
so it reads the frame target from the URLTarget field making it more flexible. I think you saying the URLTarget field is used for a mouse over
display, but I searched and cannot see that it is read anywhere else in the code so I will use it for this purpose.
Thanks
Richard
|
|
|
|
|
Hi
Replace the following code in the cs file inside the Menu condition
<code>
strRender.Append("<script type=\"text/javascript\" language=\"JavaScript1.2\">");
string MainMenuFontColor = System.Configuration.ConfigurationSettings.AppSettings["MainMenuFontColor"];
string MainMenuShadowColor = System.Configuration.ConfigurationSettings.AppSettings["MainMenuShadowColor"];
string MainMenubGColor = System.Configuration.ConfigurationSettings.AppSettings["MainMenubGColor"];
string MainMenuMouseoverColor = System.Configuration.ConfigurationSettings.AppSettings["MainMenuMouseoverColor"];
string SubmenuBgColor = System.Configuration.ConfigurationSettings.AppSettings["SubmenuBgColor"];
string SubmenuMouseoverColor = System.Configuration.ConfigurationSettings.AppSettings["SubmenuMouseoverColor"];
string SubmenuBorderColor = System.Configuration.ConfigurationSettings.AppSettings["SubmenuBorderColor"];
string SubmenuFontColor = System.Configuration.ConfigurationSettings.AppSettings["SubmenuFontColor"];
string SubmenuShadowColor = System.Configuration.ConfigurationSettings.AppSettings["SubmenuShadowColor"];
string SubmenuMouseOverFontColor = System.Configuration.ConfigurationSettings.AppSettings["SubmenuMouseOverFontColor"];
strRender.Append("stm_bm([\"phpjchr\",400,\"\",\"blank.gif\",0,\"\",\"\",0,0,0,0,50,1,0,0,\"\",\"\",0],this);");
DataView myDataView = new DataView(myXmlDataDocument.DataSet.Tables["MainMenu"]);
myDataView.Sort = "MenuSequence";
if(Display=="V" || Display=="v")
strRender.Append("stm_bp(\"p0\",[1,4,0,0,0,4,0,7,71,\"progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=0.00)\",-2,\"\",-2,10,1,4,\""+MainMenuShadowColor+"\",\"transparent\",\"\",3,0,0,\""+MainMenuFontColor+"\"]);");
else if(Display=="H" || Display=="h")
strRender.Append("stm_bp(\"p0\",[0,4,0,0,0,4,0,7,71,\"progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=0.00)\",-2,\"\",-2,10,1,4,\""+MainMenuShadowColor+"\",\"transparent\",\"\",3,0,0,\""+MainMenuFontColor+"\"]);");
for (int i = 0; i < myDataView.Count; i++){
if(isAuthorised(myDataView[i]["MainSecurity"].ToString(),SecurityType)){
strRender.Append("stm_ai(\"p0i0\",[0,'"+myDataView[i]["Label"].ToString()+"',\"\",\"\",-1,-1,0,\""+myDataView[i]["BaseURL"].ToString()+"\",\"_self\",'"+myDataView[i]["BaseURL"].ToString()+"',\"\",\"\",\"\",0,0,0,\"arrow_gray.gif\",\"arrow_gray.gif\",7,7,0,0,1,\""+MainMenubGColor+"\",0,\""+MainMenuMouseoverColor+"\",0,\"\",\"\",3,3,0,0,\""+MainMenubGColor+"\",\""+MainMenuMouseoverColor+"\",\""+MainMenuFontColor+"\",\""+MainMenuFontColor+"\",\"8pt bold Arial\",\"8pt bold Arial\",0,0]);");
DataView mySubDataView = new DataView(myXmlDataDocument.DataSet.Tables["SubMenu"]);
mySubDataView.Sort = "SubMenuSequence";
mySubDataView.RowFilter = "MenuId = " + myDataView[i]["MenuId"].ToString();
if(Display=="V" || Display=="v")
strRender.Append("stm_bp(\"p1\",[1,2,0,1,0,3,0,0,71,\"progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=1,motion=forward,enabled=0,Duration=1.00)\",5,\"\",-2,10,1,4,\""+SubmenuShadowColor+"\",\"\",\"\",3,1,1,\""+SubmenuBorderColor+"\"]);");
else if(Display=="H" || Display=="h")
strRender.Append("stm_bp(\"p1\",[1,4,0,1,0,3,0,0,71,\"progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=1,motion=forward,enabled=0,Duration=1.00)\",5,\"\",-2,10,1,4,\""+SubmenuShadowColor+"\",\"\",\"\",3,1,1,\""+SubmenuBorderColor+"\"]);");
for (int j = 0; j < mySubDataView.Count; j++){
if(isAuthorised(mySubDataView[j]["Security"].ToString(),SecurityType)){
strRender.Append("stm_aix(\"p1i0\",\"p0i0\",[0,'"+mySubDataView[j]["Label"].ToString()+"',\"\",\"\",-1,-1,0,\""+mySubDataView[j]["URL"].ToString()+"\",\"\",'"+mySubDataView[j]["URL"].ToString()+"',\"\",\"\",\"\",0,0,0,\"\",\"\",0,0,0,0,1,\""+SubmenuBgColor+"\",0,\""+SubmenuMouseoverColor+"\",0,\"\",\"\",3,3,0,0,\"\",\"\",\""+SubmenuFontColor+"\",\""+SubmenuMouseOverFontColor+"\"]);");
/*********************************************************************************/
DataView myLeafDataView = new DataView(myXmlDataDocument.DataSet.Tables["LeafMenu"]);
//myLeafDataView.Sort = "LeafMenuSequence";
myLeafDataView.RowFilter = "MenuId = " + myDataView[i]["MenuId"].ToString() +" and SubMenuId = " + mySubDataView[j]["SubMenuID"].ToString() ;
HttpContext.Current.Response.Write("outer");
strRender.Append("stm_bp(\"p1\",[1,2,0,1,0,4,0,0,71,\"progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=1,motion=forward,enabled=0,Duration=1.00)\",5,\"\",-2,10,1,4,\""+SubmenuShadowColor+"\",\"\",\"\",3,1,1,\""+SubmenuBorderColor+"\"]);");
for (int k = 0; k < myLeafDataView.Count; k++){
if(isAuthorised(myLeafDataView[k]["Security"].ToString(),SecurityType)){
HttpContext.Current.Response.Write("forwech");
strRender.Append("stm_aix(\"p1i0\",\"p0i0\",[0,'"+myLeafDataView[k]["Label"].ToString()+"',\"\",\"\",-1,-1,0,\""+myLeafDataView[k]["URL"].ToString()+"\",\"\",'"+myLeafDataView[k]["URL"].ToString()+"',\"\",\"\",\"\",0,0,0,\"\",\"\",0,0,0,0,1,\""+SubmenuBgColor+"\",0,\""+SubmenuMouseoverColor+"\",0,\"\",\"\",3,3,0,0,\"\",\"\",\""+SubmenuFontColor+"\",\""+SubmenuMouseOverFontColor+"\"]);");
}
}
strRender.Append("stm_ep();");
/*********************************************************************************/
}
}
strRender.Append("stm_ep();");
}
}
strRender.Append("stm_em();");
strRender.Append("</script>");</code>
Replace the contents of XSd file with
<code><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xsd:element name="Menu" type="menuType"/>
<xsd:complexType name="menuType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="MainMenu" type="mainMenuType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="mainMenuType">
<xsd:sequence>
<xsd:element name="SubMenu" type="SubMenuType"/>
<xsd:sequence>
<xsd:element name="LeafMenu" type="LeafMenuType"/>
</xsd:sequence>
</xsd:sequence>
<xsd:attribute name="MenuID" type="xsd:nonNegativeInteger"/>
<xsd:attribute name="MenuSequence" type="xsd:nonNegativeInteger"/>
<xsd:attribute name="MainSecurity" type="xsd:string"/>
<xsd:attribute name="BaseURL" type="xsd:string"/>
<xsd:attribute name="Label" type="xsd:string"/>
<xsd:attribute name="ImageUrl" type="xsd:string"/>
</xsd:complexType>
<xsd:complexType name="SubMenuType">
<xsd:attribute name="SubMenuID" type="xsd:nonNegativeInteger"/>
<xsd:attribute name="SubMenuSequence" type="xsd:nonNegativeInteger"/>
<xsd:attribute name="Label" type="xsd:string"/>
<xsd:attribute name="URL" type="xsd:string"/>
<xsd:attribute name="URLTarget" type="xsd:string"/>
<xsd:attribute name="Security" type="xsd:string"/>
<xsd:attribute name="CongSpecific" type="xsd:string"/>
<xsd:attribute name="MenuID" type="xsd:string"/>
<xsd:attribute name="ImageUrl" type="xsd:string"/>
</xsd:complexType>
<xsd:complexType name="LeafMenuType">
<xsd:attribute name="LeafMenuID" type="xsd:nonNegativeInteger"/>
<xsd:attribute name="SubMenuID" type="xsd:nonNegativeInteger"/>
<xsd:attribute name="LeafMenuSequence" type="xsd:nonNegativeInteger"/>
<xsd:attribute name="Label" type="xsd:string"/>
<xsd:attribute name="URL" type="xsd:string"/>
<xsd:attribute name="URLTarget" type="xsd:string"/>
<xsd:attribute name="Security" type="xsd:string"/>
<xsd:attribute name="MenuID" type="xsd:string"/>
<xsd:attribute name="ImageUrl" type="xsd:string"/>
</xsd:complexType>
</xsd:schema></code>
and the xml file should be
<code><MainMenu Label="Query Builder" BaseURL="Querybuilder.aspx" MenuID="2" MainSecurity="A" MenuSequence="2" ImageUrl="themes/triangle_blueS.gif">
<SubMenu Label="Query Maintanence" URL="Query.aspx" MenuID="2" Security="A" SubMenuID="1" SubMenuSequence="1" ImageUrl="themes/xp_documents.gif"/>
<LeafMenu Label="Create Query" URL="CreateQuery.aspx" MenuID="2" Security="A" SubMenuID="1" LeafMenuID="1" LeafMenuSequence="1" ImageUrl="themes/xp_documents.gif"/>
<LeafMenu Label="Run Query" URL="RunQuery.aspx" MenuID="2" Security="A" SubMenuID="1" LeafMenuID="1" LeafMenuSequence="1" ImageUrl="themes/xp_documents.gif"/>
<SubMenu Label="View Query" URL="ViewQuery.aspx" MenuID="2" Security="A" SubMenuID="2" SubMenuSequence="2" ImageUrl="themes/xp_newfolder.gif"/>
</MainMenu></code>
it should work file.
Venky
|
|
|
|
|
Anyone get this working? I'm having a problem. The changes suggested seem logical, but don't appear to work.
I've attempted to modify the source as instructed, but it seems to have only disabled the menu function completely. The tree appears to work, but fails to display the leafmenu elements.
Can you point me to a working source with 3 levels? If you think I've simply mixed up the source I can tell you I've done:
1) download and unzip the package from codeproject.com
2) Modified the Fourinone.cs file (the "Render" method)
3) Replace the .XSD file
4) Replaced the .XML file
Any help would be appreciated. Thanks.
Rich
|
|
|
|
|
I'm having exactly the same problem - this control is fantastic, and I would love to use it, but I need three levels. Are any working samples available?
Many Thanks,
Nate
|
|
|
|
|
Thank you Venkat!!
It worked for me, however i modified a couple of lines in the part added by venkat to handle the third level (this part is delimited by venkat with /*****) Hope it Helps!!
/*********************************************************************************/
DataView myLeafDataView = new DataView(myXmlDataDocument.DataSet.Tables["LeafMenu"]);
//myLeafDataView.Sort = "LeafMenuSequence";
myLeafDataView.RowFilter = "MenuId = " + myDataView[i]["MenuId"].ToString() +" and SubMenuId = " + mySubDataView[j]["SubMenuID"].ToString();
//HttpContext.Current.Response.Write("outer");
strRender.Append("stm_bp(\"p1\",[1,2,0,1,0,4,0,0,71,\"progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=1,motion=forward,enabled=0,Duration=1.00)\",5,\"\",-2,10,1,4,\""+SubmenuShadowColor+"\",\"\",\"\",3,1,1,\""+SubmenuBorderColor+"\"]);");
for (int k = 0; k < myLeafDataView.Count; k++){
if(isAuthorised(myLeafDataView[k]["Security"].ToString(),SecurityType)){
//HttpContext.Current.Response.Write("forwech");
strRender.Append("stm_aix(\"p1i0\",\"p0i0\",[0,'"+myLeafDataView[k]["Label"].ToString()+"',\"\",\"\",-1,-1,0,\""+myLeafDataView[k]["URL"].ToString()+"\",\"\",'"+myLeafDataView[k]["URL"].ToString()+"',\"\",\"\",\"\",0,0,0,\"\",\"\",0,0,0,0,1,\""+SubmenuBgColor+"\",0,\""+SubmenuMouseoverColor+"\",0,\"\",\"\",3,3,0,0,\"\",\"\",\""+SubmenuFontColor+"\",\""+SubmenuMouseOverFontColor+"\"]);");
}
}
strRender.Append("stm_ep();");
/*********************************************************************************/
Guillermo Mejía
|
|
|
|
|
Venkat,
The submenu's are somewhat transparent. I need to set them to solid. Can you point out the code that will allow me to set the submenu to a solid color?
Thanks
David Jenkins
|
|
|
|
|
David,
strRender.Append("stm_bp(\"p0\",[1,4,0,0,0,4,0,7,71,\"progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=1.00)\",-2,\"\",-2,10,1,4,\""+MainMenuShadowColor+"\",\"transparent\",\"\",3,0,0,\""+MainMenuFontColor+"\"]);");
find the above line in the cs file. Chnage the value 71 to some other number. give 0 for opaque. 100 for pure transparent.
Venky
|
|
|
|
|
I have created a log of what I have done to try and get the control to work for me. I am pretty good at getting around in VS and a new C# programmer. I am using Visual Studio 2003 vs. 7.1.3088.
Log
Download – extract
create virtual directory – browse
login page default.aspx OK
login with admin/admin
Done – no redirect. Unable to login.
Visual Studio 2003
New Project – Existing Folder
Name = Fourinone
Show All Files – include in Project
Open controls.aspx
Error: No class associated with file – create one now?
Solution: Yes – creates controls.aspx.cs
Open default.aspx
Error: File could not be loaded into web form designer. Please correct… The @Page or @Control contains a src= …
Solution: remove src= replace with Codebehind=default.aspx.cs
Also: tag should be after directives and above
Browse Project in PWM (IIS)
Server Error in '/' Application.
-----------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'Login'.
Source Error:
Line 1: <%@ Page Language="C#" Debug="true" Trace="false" inherits="Login" Codebehind="Default.aspx.cs"%>
Line 2:
Line 3:
Source File: C:\etc\ComboControl\Default.aspx Line: 1
-----------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
Solution: Change inherits to _default, Fourinone._default, fourinone.default, etc – nothing works so move on.
Debug(F5)
Error: Visual Studio cannot debug the project because the debug target fourinone.exe is missing. Please build the Project and retry.
Solution: Build Solution and Build Project – same response in regards to the missing target.
Build Solution:
Error: Style and style attributes not recognized.
Solution: Add (appropriate to your project) meta tags or you will get errors regarding style attributes.
Error: c:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Data.dll Referenced class 'System.Xml.XmlDataDocument' has base class or interface 'System.Xml.XmlDocument' defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml'.
This is where I am unable to move forward, the code looks OK to me. Please help Venkat or any more experienced Visual Studio .NET C# programmers who have successfully implemented this control.
I also tried using the control in an existing project and creating a new project by adding FOURINONE.dll, helper/, themes, etc as ‘How I use the control’ suggested (Thank you - very clear). I then created my own web user control using your FOURINONE.cs as the Codebehind (with tweaks) and I get an error in reference to the same Xml.XmlDocument and Xml.XmlDataDocument classes.
Thanks in advance for your help !
|
|
|
|
|
I'm having trouble getting the tab to work correctly. Is there a bug in the code? I saw references to 'MainMenu_Id'. I fixed that particular issue but something else seems to be off .. not sure what.
Is there a new version of the code available?
thanks
ap
|
|
|
|
|
Is there any way to change the font type and size?
Thanks
|
|
|
|
|
You can change the Font
strRender.Append("stm_ai(\"p0i0\",[0,'"+myDataView[i]["Label"].ToString()+"',\"\",\"\",-1,-1,0,\""+myDataView[i]["BaseURL"].ToString()+"\",\"_self\",'"+myDataView[i]["BaseURL"].ToString()+"',\"\",\"\",\"\",0,0,0,\"arrow_gray.gif\",\"arrow_gray.gif\",7,7,0,0,1,\""+MainMenubGColor+"\",0,\""+MainMenuMouseoverColor+"\",0,\"\",\"\",3,3,0,0,\""+MainMenubGColor+"\",\""+MainMenuMouseoverColor+"\",\""+MainMenuFontColor+"\",\""+MainMenuFontColor+"\",\"8pt Arial\",\"8pt Arial\",0,0]);");
search for this line in the cs file. change the 8pt Arial to your desired font and size.
David
|
|
|
|
|