Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi ;

I added a linkbutton to my datalist,and i connected my datalist to my database...

So, i want to do that when a user clicks to my datalist item , properties of that item will be shown on the screen...

For example i design a food website, my datalist lists all food names in my database , and user clicks any of this food names , my website shows this foods properties and make instructions middle of the page...

How can i do this?

Thanks;)
Posted

1 solution

You can use Eval function to achieve this:

XML
NavigationUrl='<%#Eval("<yourLinkColumnHere>")%>'


This will propagate your link as you desire...
 
Share this answer
 
Comments
Onur ERYILMAZ 20-Jul-13 16:54pm    
Thanks to answering my question , but i not want to add URL my linkbutton actually :)
If user click my datalist item(which is any food name) , this item's information apperars on the middle of my web page...

protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "CommentArea")
{

}
}

So , what can i write in my item click event to do this...
Arpit Shrivastava 20-Jul-13 17:06pm    
You can either popup another page and pass your item id via URL request string and fetch it on other page. you can also use JQuery Popup, like Lightbox to achieve this...
Arpit Shrivastava 20-Jul-13 17:09pm    
I got confuse because of your header question, you need to refine that...
Onur ERYILMAZ 20-Jul-13 17:25pm    
I want to something like this site;
http://en.wikipedia.org/wiki/Main_Page
As you see you click items on the left area , item content is appears middle of the page...
Arpit Shrivastava 21-Jul-13 7:06am    
Have you heard about Master Pages... Please search it on google and i think this will provide you want you need...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900