Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 19th, 2007, 01:32 PM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mehrdad_T
Default how to insert web user control in DataList

I have a problem and will be tankfull if you help me,

I want to design a site which have a different news section ex about Sport,Science ...and so on.

I want the control panel gives the Authority to admin to design different news group which will be shown in the different tables in first page of the site

and this tables hold the latest news about each news section.

I expect to use the web user control to design a template for tables and DataList control but I have problem here I dont know how to insert web user control in DataList control?

like this :
http://teanet.somee.com/photo/Sample.JPG

and if u know better way to design this please tell me.

tnx.

 
Old June 25th, 2007, 07:11 AM
Authorized User
 
Join Date: Jun 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to naeem.net Send a message via Yahoo to naeem.net
Default

Hi ,

1- Put <div id="p_news" runat="server"/> instade of the first table.
2- Use the tags of your first table in the code section with sql query of your first table like that :

 sql= " select * from tabname"
 .
 .

 Dim r as datarow
 dim resulttab as string

 resulttab = "<table id='news'>"

 For each r in dataset.("tabname").rows
  resulttab & = "<td><tr>" & r("newsrecord").tostring()& "</tr></td>"
next

  resulttab & = "</table>"

  p_news.innerhtml = resulttab


 enjoy with it

 Ali Naeem


Ali Naeem
 
Old June 25th, 2007, 07:20 AM
Authorized User
 
Join Date: Jun 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to naeem.net Send a message via Yahoo to naeem.net
Default

For live example see the like below :

  www.aafaq.org

Ali Naeem





Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Windows User control in Web User Control agarwalvidhu C# 0 March 30th, 2006 01:17 AM
DataList Web control causes screen flicker Jan_Ma Classic ASP Basics 1 July 15th, 2003 03:47 PM
DataList Web Control causes screen flicker Jan_Ma BOOK: ASP.NET Website Programming Problem-Design-Solution 0 June 30th, 2003 04:39 PM
DataList Web control causes screen flicker Jan_Ma Classic ASP Professional 0 June 30th, 2003 04:38 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.