| |
| Tutorial - SelectedId
|
Each menu item has a unique ID.
There are two ways to get the selected item ID:
- Using postbacks
- By setting AutoQueryString = true property and getting the value from Query String
This menu uses postbacks to display the selected item ID:
Currently selected: a_a_pb
![]() Company Home ![]()
Entertainment
![]()
Games
![]()
Greeting Cards
![]()
Downloads
![]()
New Cars
![]()
Used Vehicles
![]()
Smart Stuff
![]() System Tasks ![]()
View system info
![]()
Add programs
![]()
Change settings
![]()
Add users
![]() Other places ![]()
My Network Places
![]()
My Documents
![]()
Shared Documents
![]()
Control Panel
![]() Short Parent ![]()
Make a new folder
![]()
Publish to the Web
![]()
Share this folder
![]() Explore Site ![]()
Business
![]()
Buy Tickets
![]()
Careers
![]() Resources ![]()
E-newsletters
![]()
Discussion Center
![]()
White Papers
![]()
Online Courses
![]()
Online Book Library
![]()
Books & CDs
![]()
Free Product Info
Sample code
|
This menu uses Query String to set the Selected ID value:
Currently selected: a_a_qs
![]() Company Home ![]() System Tasks ![]() Other places ![]() Short Parent ![]() Explore Site ![]() Resources
Sample code
|
| | |
Postback - ASP.NET
<osm:SlideMenu
id = "tutSelID"
runat = "server"
SelectedId = "c11" >
<menuitems>
<osm:Parent id="p1">Company Home</osm:Parent>
<osm:Child id="c11" OnClick="menuClick">
Entertainment
</osm:Child>
<osm:Child id="c12" OnClick="menuClick">
Games
</osm:Child>
<osm:Child id="c13" OnClick="menuClick">
Greeting Cards
</osm:Child>
<osm:Child id="c14" OnClick="menuClick">
Downloads
</osm:Child>
<osm:Parent id="p2">System Tasks</osm:Parent>
<osm:Child id="c21" OnClick="menuClick">
View system info
</osm:Child>
<osm:Child id="c22" OnClick="menuClick">
Add programs
</osm:Child>
</menuitems>
</osm:SlideMenu>
| | |
Query String - ASP.NET
<script language="C#" runat="server">
void Page_Load(object sender, EventArgs e) {
string osmId = Request.QueryString["sm"];
if(osmId != null)
tutSelId.SelectedId = osmId;
}
</script>
<osm:SlideMenu
id = "tutSelID"
runat = "server"
SelectedId = "c11" >
<menuitems>
<osm:Parent id="p1">Company Home</osm:Parent>
<osm:Child id="c11" Url="tutorial_selectedid.aspx">
Entertainment
</osm:Child>
<osm:Child id="c12" Url="tutorial_selectedid.aspx">
Games
</osm:Child>
<osm:Child id="c13" Url="tutorial_selectedid.aspx">
Greeting Cards
</osm:Child>
<osm:Child id="c14" Url="tutorial_selectedid.aspx">
Downloads
</osm:Child>
<osm:Parent id="p2">System Tasks</osm:Parent>
<osm:Child id="c21" Url="tutorial_selectedid.aspx">
View system info
</osm:Child>
<osm:Child id="c22" Url="tutorial_selectedid.aspx">
Add programs
</osm:Child>
</menuitems>
</osm:SlideMenu>
| | |
| "I like your support... Great!!!!
" |
Saravanakumar |
|
| | |
|
|
|
|