Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Menu

Menu

Ratings: (0)|Views: 13 |Likes:
Published by api-3848319

More info:

Published by: api-3848319 on Oct 18, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

<asp:menu id="menu1" itemwrap="true" runat="server" font-names="ariel" font-
size="8pt" forecolor="lightgray" backcolor="#191919" onmenuitemclick="menuitem"
staticsubmenuindent="8px" width="190px"
statictopseparatorimageurl="~/images/line1.jpg"
staticpopoutimagetextformatstring=""
dynamicbottomseparatorimageurl="~/images/line1.jpg">

<dynamicmenuitemstyle font-bold="false" forecolor="lightgray"

width="150px" font-names="ariel" font-size="8pt" backcolor="#191919" />
<dynamicmenustyle backcolor="#191919" forecolor="lightgray" />
<dynamicselectedstyle backcolor="#191919" />
<staticmenuitemstyle horizontalpadding="2px"

verticalpadding="2px" backcolor="#191919" />
<dynamichoverstyle backcolor="#191919" />
<statichoverstyle backcolor="#191919" />

<staticmenustyle backcolor="#191919" />
<staticselectedstyle backcolor="#191919"/>
</asp:menu>
private void displaymenu()

{
con.open();
try
{

sqldataadapter da = new sqldataadapter("select * from category_info",

con);
dataset ds = new dataset();
da.fill(ds,"cat");
menuitem cat = null;
menuitem subcat = null;
string id = "";
if (ds.tables[0].rows.count > 0)
{

foreach (datarow dr in ds.tables[0].rows)
{
id = dr["categoryid"].tostring();
//system.web.ui.webcontrols.image img = new

system.web.ui.webcontrols.image();
//img.imageurl = "images/" + "icon2.gif";
cat = new menuitem();
cat.imageurl = "images/" + "icon2.gif";
//string s = img.imageurl;
cat.text =(string)dr["categoryname"].tostring();
cat.value = id;
menu1.items.add(cat);
sqldataadapter da1 = new sqldataadapter("select * from

subcategory_info where categoryid='" + id + "'",con);
dataset ds1 = new dataset();
da1.fill(ds1,"subcat");
if (ds1.tables[0].rows.count > 0)
{

foreach (datarow dr1 in ds1.tables[0].rows)

{
if (dr1["subcategoryname"].tostring() != "")
{

subcat = new
menuitem((string)dr1["subcategoryname"].tostring());
subcat.text=(string)dr1["subcategoryname"].tostrin

g();
subcat.value = dr1["subcategoryid"].tostring();
cat.childitems.add(subcat);

}
}
}else

{
string items = "no items";
subcat = new menuitem((string)items);
cat.childitems.add(subcat);

}
}
}else
{}
}catch (exception ex)
{
response.write(ex.message);
}con.close();
}
protected void menuitem(object sender, menueventargs e)
{
try

{
menuitem mitem = (menuitem)e.item;
string menui = mitem.value;
con.open();
sqlcommand cmd = new sqlcommand("select * from category_info where

categoryid='"+convert.toint32(menui.tostring())+"'", con);
sqldatareader dr = cmd.executereader();
dr.read();
if (dr.hasrows)
{

session["categoryid"] = menui.tostring();
dr.close();
con.close();
response.redirect("subcategory.aspx");

}else

{
session["subcategoryid"] = menui.tostring();
dr.close();

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->